We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to get value of reference field using server script

Not applicable

How to get value of reference field using server script

5 REPLIES 5

ABHAY_M
Tera Guru

you can try this on business rule

var a = current.getDisplayValue('feildname');

gs.addInfoMessage(a);

Anurag Tripathi
Mega Patron

Hi,

You can use

current.field_name.getDisplayValue()

OR

gr.field_name.getDisplayValue(); //gr being the glide record object of the record

-Anurag

-Anurag

suvro
Mega Sage

What is the issue you are facing ?

For example of assignment group field

current.getDisplayValue("assignment_group"); //Will give name of the assignment group

current.getValue("assignment_group"); //Will give the sys_id of the assignment group

Ankur Bawiskar
Tera Patron

Please explain your business requirement and give some context and screenshots where you want this?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader