getValue on a reference field

omfortes
Kilo Expert

Hi Guys,

I'm trying to retrieve the display value (value that is shown on a form) on a reference field. I'm using g_form.getValue('field_name') but it brings back the sys_id. Is there any way to display the value shown on a form? I understand the reason it's doing this just need the display value returned.

An example to use would be the caller on the Incident form?

1 ACCEPTED SOLUTION

omfortes
Kilo Expert

Nevermind, got the answer using g_form.getDisplayBox('<field_name').value;  


View solution in original post

3 REPLIES 3

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

Please see this thread as it has solutions to your question:


getDisplayValue() not working in a catalog client script


omfortes
Kilo Expert

Nevermind, got the answer using g_form.getDisplayBox('<field_name').value;  


jlrh
Kilo Contributor

Any option to copy the value of a reference field to a strig field,usig business rule after submit.