How to convert List collector to String in flow designer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 08:48 PM
Hi Everyone,
I have a requirement where for a field multiple user needs to be selected at a same time. That's why I have used a List Collector as type for that variable. Once the form is getting submitted on the RITM description sysid are populating for that variable. I want the name of the user selected on the portal to be shown in the description of RITM and I am using a flow designer. How can I achieve that.
Thanks,
Harsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 01:55 AM
Hi @Harsh3842,
Good day!
1. You can create Flow variables in the flow.
2. Once the flow variables are created. Please use the Flow logic to set the flow variables
3. You can set the variable value using script as mentioned below.
var readID = 'List variable'; // List field from the flow
var readName = getName(readID);
return readName;
function getName(ids){
var sysId = ids.split(',');
var name=[];
for(var i = 0 ; i < sysId.length ; i++){
var accountName = new GlideRecord('reference_table_name'); // Reference table of the list field.
accountName.get(sysId[i]);
name[i] = accountName.'field_name'; // Name/String which needs to be displayed
}
var name_str = String(name); // Convert the array to string and return to the function
return name_str;
}
Hope this information is helpful.
Best Regards,
Naveen