
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2021 05:49 AM
Does anyone know how to get the display values from a List field within an inline script in Flow Designer?
Here is the information:
- List field is on the core_company field called "u_sub_id"
- The flow runs against a catalog item that contains a reference variable (called "customer") that references [core_company]
- Within the inline script, I want to return the first entry in the List field into a variable. Since the variable references core_company, I can dot-walk to the "u_sub_id" field. However, when I print out the results of the variable to the log, it is returning "object GlideRecord".
Here are some of the things I've tried in the inline script:
// _2__update_record is updating the RITM record
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2021 06:28 AM
Hi,
how the values in the list field looks like?
So are you saying it is only returning only the 1st choice
can you share the image how many choices that list field has
As an alternative can you try this
var rec = new GlideRecord('core_company');
rec.addQuery('sys_id', fd_data._1__get_catalog_variables.customer);
rec.query();
if(rec.next()){
return rec.u_sub_id;
//OR
return rec.u_sub_id.getValue();
// OR
return rec.u_sub_id.getDisplayValue();
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2021 06:10 AM
Hi,
this worked well for me for getting display value of list collector variable
return fd_data.trigger.request_item.variables.my_user.getDisplayValue();
for your case update as this
var val = fd_data.trigger.request_item.variables.customer.u_sub_id.getDisplayValue();
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2021 06:21 AM
Hi Ankur,
I simplified my flow so it has a "Get Catalog Variables" and a "Log" actions. Within the Log action, I have the following in the inline script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2021 06:28 AM
Hi,
how the values in the list field looks like?
So are you saying it is only returning only the 1st choice
can you share the image how many choices that list field has
As an alternative can you try this
var rec = new GlideRecord('core_company');
rec.addQuery('sys_id', fd_data._1__get_catalog_variables.customer);
rec.query();
if(rec.next()){
return rec.u_sub_id;
//OR
return rec.u_sub_id.getValue();
// OR
return rec.u_sub_id.getDisplayValue();
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2021 06:39 AM