salvadormar
Kilo Guru

Try this:


var name = g_form.getReference('application_name').fieldname;




...where 'fieldname' is the field name of the User table where the name of the person is stored.


also, 'name' is widely used...I recommend 'myName' instead.




OR....try this:




var myName = g_form.getDisplayValue('application_name');


g_form.setValue('appowner', myName );




Thanks!  I used the below code to copy list collector values to a text box in order to include the variable in my flow designer email. 

var myName = g_form.getDisplayValue('application_name');

g_form.setValue('appowner', myName );

Anurag Tripathi
Mega Patron

Hi Chad,



if appowner is a reference field to the sys_user field then it will work as expected, else you will have to extract the user name from this name.u_appowner in the same was as you extracted u_appowner from application_name, ie using getReference.



a better approach will be   that you pass application_name to a script include using glideajax and there you can directly extract the u_appowner and get the display value of u_appowner by using .getDisplayValue().


-Anurag

View solution in original post

can you please provide us example with some code? i am experiencing similar issue


What exactly do you want to achieve....this is an old post....and if going through it doesn't solve ur issue then....tell me what you are trying


-Anurag