- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 05:56 PM
Hi All,
I have record producer with a variable List Collector referring to cmdb_ci table and mapped to text field (short description on Incident table ) so when I submit this form it displays sysid's of below selected CI's in Short Description field as highlighted in below screens.Is there any way to show theDisplay Value(Name) of CI's in Short Description field.
Appreciate your response !
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 07:44 PM
Please try the below script
var test = producer.YOUR_FIELD_NAME.toString();
if (test != '') {
var myString1Split = test.split(',');
var str = '';
for(i = 0; i < myString1Split.length; i++) {
var mylst = new GlideRecord('cmdb_ci');
mylst.addQuery('sys_id', myString1Split[i]);
mylst.query();
while(mylst.next()){
str += mylst.name + ', ';
}
}
current.short_description = str;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 06:29 PM
Can you show the script that copies selected list to short_description? Can you try
short_description = selected_list.getDisplayValue();
Hope this helps.
Please feel free to connect, follow, mark helpful / answer, like, endorse.
John Chun, PhD PMP ![]() | ![]() |
Winner of November 2016 Members' Choice Award

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 07:44 PM
Please try the below script
var test = producer.YOUR_FIELD_NAME.toString();
if (test != '') {
var myString1Split = test.split(',');
var str = '';
for(i = 0; i < myString1Split.length; i++) {
var mylst = new GlideRecord('cmdb_ci');
mylst.addQuery('sys_id', myString1Split[i]);
mylst.query();
while(mylst.next()){
str += mylst.name + ', ';
}
}
current.short_description = str;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2018 12:16 AM
Thank you. The way ServiceNow has it setup--apparently needing to loop through and do as many queries as elements instead of just being able to pass a query for all sys_ids in a list is inefficient, and surely slows their system down, but thank you for knowing the nuances of the system like this, it just helped me out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 08:48 PM
It worked like a charm Thanks for the response .