Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to get value of reference field using server script

Community Alums
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
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
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