The CreatorCon Call for Content is officially open! Get started here.

How to get Reference field value through client script?

rezacol
Mega Expert

Guys -

Is there a way to get the display value of the Reference field in client script ?? When I do g_form.getValue('ref_field'), I am getting the sys_id instead of value. Letme know is there a way to get the display value ??

 

Thanks in Advance,

Reza R.

1 ACCEPTED SOLUTION

rezacol
Mega Expert

Thanks guys for all your response. But I was able to complete my client requirements via the script in UI policy.


View solution in original post

8 REPLIES 8

Community Alums
Not applicable

Hi Rahman,



You canuse getRefernce( fieldname) .



Regards,


kirti


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Reza,



I have already answered a similar question in the below thread.


Catalog client script - string value of a reference variable


Hey Pradeep -



Its not working. My field is a multiple selection reference field. I tried your getDisplayBox() method but no success.



Thanks,


Reza R.


list collectors?



if yes, you will need to query and get the display values.....