Create Task based on the choice selected in List Collector using ServiceNow Flow Designer

Community Alums
Not applicable

Hi There,

 

Greetings!!!

 

We have a requirement to generate task based on the choice / choices selected in list collector on catalog item. Based on choices the catalog task should be generated through flow designer.

 

The list collector field contains 5 choices (User can select one or multiple values) 

Name of the field - (Numbers - numbers)

1) One 2) Two 3) Three 4) Four 5) Five

 

Based on the choice / choices selected it should create different catalog task / tasks. But we are unable to get the sys_ids using the

Step 1 : Lookup records

Tejas12_0-1712257942211.png

Step 2 : For Each item

Tejas12_1-1712258021291.png

 

Step 3 : Using the above step reference

Tejas12_2-1712258143462.png

 

Step 4: Create catalog task

Tejas12_3-1712258233171.png

 

I have gone through the Ankur Bawiskar's article can someone explain that for this requirement.

 

Thanks in advance!

 

Regards,

Tejas

 

2 REPLIES 2

James Chun
Kilo Patron

Hi @Community Alums,

 

So the number of tasks generated will be dependent on the user's selection?

If so, I would do the following instead:

 

  • Use 'Get Catalog Variables' action to fetch submitted variables
  • Create a Flow variable and assign the value of the submitted variable. This will act as a counter.
  • Use 'Do the following' Flow Logic to iterate until counter is completed
  • Within the 'Do the following', create SCTASKS and decrement the counter by one at the end

Cheers

 

Kai Tingey
Tera Guru

You can use a 'get catalog variables' flow action to access the list collectors contents.

then use a lookup records action to look up the various records in the list collector. You will need to look them up by whatever table they are in and their sys_id. 

Example, we have one for users requesting access to one or many corporate applications. The list collector allows them to select records from the business services table.

KaiTingey_0-1712280826340.png

 

Then you can use a combination of for each and if logic to do with them what you want. 

 

e.g. for each (item in list) if (condition matches true) do (something)

 

in the example above we do a for each record selected, create a catalog task, and then if certain conditions match - we update the catalog task appropriately.

KaiTingey_1-1712281105271.png

 

hope that helps.