- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 08:41 AM
Is there a simple solution to getting the display value from a data pill rather than the sys_id?
I'm sending an email via a workflow and would like to show the actual names of the users select in a members list rather than their sys_ids.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 11:56 AM
Managed to figure this out.
A foreach loop does suffice but didn't meet the formatting I wanted.
The solution I used was to set a flow variable, returning an array of the data.
var resMembers = fd_data.trigger.current.members_list.split(',');
var memberArr = [];
resMembers.forEach(function(id)
{
var usergr = new GlideRecord('sys_user');
if (usergr.get(id))
{
memberArr.push((usergr.name));
}
});
return memberArr.join(', ');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 08:49 AM
Hi @MBarrott
In the flow we have this, when we get a reference type field, the sys_id will always appear instead of the display value.
To get around this, you can do a lookup record inside a forEach and use a flow variable to create a list with the names of the records found in the lookup.
If my answer helps you in any way, please mark it as correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 11:56 AM
Managed to figure this out.
A foreach loop does suffice but didn't meet the formatting I wanted.
The solution I used was to set a flow variable, returning an array of the data.
var resMembers = fd_data.trigger.current.members_list.split(',');
var memberArr = [];
resMembers.forEach(function(id)
{
var usergr = new GlideRecord('sys_user');
if (usergr.get(id))
{
memberArr.push((usergr.name));
}
});
return memberArr.join(', ');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 12:03 PM
Very Cool, I'm glad you managed it this way, but what I suggested is exactly that, but through the flow interface, reducing encapsulation in complexity
the flow's forEach and within it a Record lookup, and in this lookup you will use the sys_id of the forEach position to find the record and in a flow variable you concatenate the names forming an array of names.