- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2014 09:47 AM
Not sure why but the getDisplayValue for the Glide List is coming out as sys_ids. This Glide List (u_linked_records) is a list of entries in the Task table.
var newLR = current.u_linked_records.toString(); //New Array of the Linked Records gs.log('SYS_ID Value: '+current.u_linked_records.toString()); var newLRArr = newLR.split(","); var newLRNum = current.u_linked_records.getDisplayValue(); //New Array of the Linked Records with Numbers gs.log('Display Value: '+current.u_linked_records.getDisplayValue()); var newLRNumArr = newLRNum.split(",");
Result:
SYS_ID Value: 217a717934be11003fd4f7967b28e115,52bebd7934be11003fd4f7967b28e194
Display Value: 217a717934be11003fd4f7967b28e115, 52bebd7934be11003fd4f7967b28e194
Any help would be appreciated.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2014 06:15 AM
this should work fine for you.
https://wiki.servicenow.com/index.php?title=Referencing_a_Glide_List_from_a_Script
Did you check if you display value is set to true for the dictonary field 'number' on the task table?
Tested on calgary instance, and its working fine for me.
var gr = new GlideRecord('incident');
if (gr.get('9d385017c611228701d22104cc95c371')){
gs.print(gr.number) //show me the current incident nummer
var newLRNum = gr.u_related_records.getDisplayValue();
gs.print(newLRNum)//show me the display value of the watchlist.
}
*** Script: INC0000002
*** Script: CHG0000001, CHG0000002
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2017 09:07 AM
Below mentioned code not working.....
plse check your self...
i hope plse modify that code..........
- var gr = new GlideRecord('incident');
- if (gr.get('9d385017c611228701d22104cc95c371'))
- {
- gs.print(gr.number) //show me the current incident nummer
- var newLRNum = gr.u_related_records.getDisplayValue();
- gs.print(newLRNum)//show me the display value of the watchlist.
- }

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2017 01:50 PM
Hi D Kishore,
I have the same problem... It seems as if the getDisplayValue on a GlideList only works after you have created the record.
I am trying to get this value on a before insert business rule with no luck.
Did you manage to find a solution?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2017 10:50 AM
The ServiceNow Wiki content is no longer supported. Updated information about this topic is located here: Referencing a Glide List from a Script
Visit http://docs.servicenow.com for the latest product documentation