- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2022 04:33 AM
Hello Community!
I need to create a simple flow which adds one user to multiple groups selected via a "List Collector" variable in an Catalog Item.
I cant figure out how to achieve this. I already looked up similar questions in the community but couldnt find anything matching.
Also I already tried it with a "for each" action which didnt worked, in addition to that my scripting knowledge is not advanced enough to give that a try.
Feel free to ask any questions if you dont understand my need or if you need further informations.
Thank you in advance!
Sebastian
Solved! Go to Solution.
- Labels:
-
flow designer
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2022 01:38 AM
Hi,
I have built a Flow that does precisely that.
Below is a simplified image on how it works, in my flow I have added some logic to first identify if the user already exists as a member in the group, and only if it doesn't exist, I create a group membership record.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2022 07:38 AM
Hi Sebastian,
I thought a simple "for each" action in the flow designer should work, but when I tried to reproduce it, I noticed, that somehow I can not access the value in the action (it is greyed out and can not be dragged and dropped). Probably you encountered the same issue.
Apparently it is an issue with the list collector, that is not correctly handled by the flow designer.
However, I found this workaround, which would include some scripting:
https://community.servicenow.com/community?id=community_blog&sys_id=e244e902dbcc2010fb4ae15b8a9619c3
Besides that, there is another low code approach that I would suggest: Instead of using a List Collector use a "Multi-Row Variable" Set to select the required groups. Regarding the UI it will look differently, but you can definitely loop over this variable type in the flow designer.
Greetings,
Sören

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2022 01:26 AM
Hi Soren, Can you confirm the field/datapill that you added to for each action is correct. When I tried, I could able to select and iterate through list field. Screenshot attached to the reply for this question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2022 01:16 AM
Hi
Please mark my answer as Correct and Helpful if this resolves your issue.
Regards,
Vamsi S

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2022 01:38 AM