How to get value of reference field using server script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2022 02:27 AM
How to get value of reference field using server script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2022 02:30 AM
you can try this on business rule
var a = current.getDisplayValue('feildname');
gs.addInfoMessage(a);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2022 02:33 AM - edited ‎10-04-2022 02:33 AM
Hi,
You can use
current.field_name.getDisplayValue()
OR
gr.field_name.getDisplayValue(); //gr being the glide record object of the record
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2022 02:41 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2022 03:05 AM
Please explain your business requirement and give some context and screenshots where you want this?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader