Looping Through a List Collector to have Catalog Task created by the User Listed in FLOW Designer

Peter Williams
Kilo Sage

Good Day everyone,

i have this list collector in my Service Catalog that will ask users to enter in User names on it.

From this i would like to have my flow designer to collect these people and for each person create a catalog task and assign it to those people

 

so far i have this and is not working

 

PeterWilliams_0-1665581784307.png

 

i am getting the catalog variable from the form and then looking up the record on the user table

 

but in the for each item it only allows me to select the Get Catalog Variable and not the look up variable

 

When i test it, the For Each Item shows 0 records.

 

what can i do?

1 ACCEPTED SOLUTION

Mike_R
Kilo Patron
Kilo Patron

Per SN, you'll need to "create a custom action that uses a string as the input, parse the string into an array, then outputs the array to be used in the For Loop. "

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0793340

 

Here's an example on how to do that

https://www.servicenow.com/community/developer-blog/using-list-collector-in-flow-designer-for-each-l...

View solution in original post

9 REPLIES 9

Muhammad Khan
Mega Sage
Mega Sage

You can try with below steps.

  1. Use Get Catalog Variables Action to get list collector values.
  2. Use Lookup Records Action on sys_user table to get an array object of users.
  3. Use For Each Flow Logic to loop through array object.
  4. Use Create Catalog Task to create a task for each user record found.

i did that in my screen shot however its not working 

i am not able to use the array object for the for each in the flow

Looks like you are using Look Up Record rather than Look Up Records (this will return an array of records).

 

So, either use Look Up Records or if you do not want to use it then try to utilize sys_ids from your list collector to create tasks directly.

That worked for me for a similar challenge I had. Thank you