
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2024 12:32 PM
Hello!
My form has a list of departments and users are able to select multiples. In flow designer I want to grab the names of all departments they selected. Is this possible with just flow designer or do i need a script? If a script, can you suggest something? thanks so much.
Brian
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2024 04:55 PM
Thanks to everyone who provided feedback on this. Each of your answers helped me determine my best approach. I ended up doing the following:
1. Retrieve the list of departments they selected on form. This comes in the form of a comma separated string.
2. I created a custom action to turn that comma separated string in to an array.
3. I used a FOR EACH loop in the flow designer to cycle through the array. I wrote each department name in to a string called departments.
4. i added that departments string to the story record where I wanted it to land.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2024 10:28 PM
Please check if below post helps :
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2024 11:30 PM - edited 09-12-2024 11:31 PM
We don't have to parse string to array, The condition "is one of" can work with the comma separated values.
In your lookup records you can use 'sys_id || is one of || your list data pill'.
Alternate way to get all the department names,
1. Create a flow variable.
2. Use Set Flow Variable with script option to get all the department names.
//Use below code in set flow variable script part.
var grCD = new GlideRecord('cmn_department');
grCD.addEncodedQuery("sys_idIN"+fd_data.trigger.request_item.watch_list); // change the fd_data as per your requirement.
grCD.query();
var dep = [];
while (grCD.next()) {
dep.push(grCD.name.toString())
}
return dep.toString();
3. Use Above flow variable in your action( You can just drag and drop the flow variable pill)]
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2024 04:55 PM
Thanks to everyone who provided feedback on this. Each of your answers helped me determine my best approach. I ended up doing the following:
1. Retrieve the list of departments they selected on form. This comes in the form of a comma separated string.
2. I created a custom action to turn that comma separated string in to an array.
3. I used a FOR EACH loop in the flow designer to cycle through the array. I wrote each department name in to a string called departments.
4. i added that departments string to the story record where I wanted it to land.