The CreatorCon Call for Content is officially open! Get started here.

Workflow: Dynamic Task Creation

kchorny
Tera Guru

I have created a catalog item with a multi-row variable set.  For each item in the MRVS, I want to create a task.  Below is my workflow while it is running.  I have a 'loops' scratchpad variable that is storing the number of items submitted minus 1 (so that I can use it as an array index as well).  The second 'if' activity decrements the loops variable by 1 then checks to see if it needs to loop again.  When I test this, the first and last tasks are created, but when the workflow loops back to the Catalog Task activity after the first time it runs, another catalog task is not created.  I wonder if I'm running into some kind of system limitation that doesn't allow me to use the same Catalog Task activity twice or something...?

For this test, I put 4 items in the MRVS but only two tasks were created.  The log results are:

find_real_file.png

And the running workflow looks like this:

find_real_file.png

 

 

 

1 ACCEPTED SOLUTION

Pooja Devkar
Mega Guru

Hello,

Refer below links for your query:

https://community.servicenow.com/community?id=community_question&sys_id=0e9bcb61db9cdbc01dcaf3231f96...

Please mark correct & helpful; if it's useful to you.

Thanks & Regards,

Pooja Devkar

View solution in original post

3 REPLIES 3

Pooja Devkar
Mega Guru

Hello,

Refer below links for your query:

https://community.servicenow.com/community?id=community_question&sys_id=0e9bcb61db9cdbc01dcaf3231f96...

Please mark correct & helpful; if it's useful to you.

Thanks & Regards,

Pooja Devkar

Thank you, I am leaning towards a similar approach.  It's an alternate solution, but doesn't really address why we can't use the same catalog task activity more than once.  I suspect it has something to do with the activity being marked 'finished' after the first run, but that's just a theory at this point.

kchorny
Tera Guru

Per support, you can't use the same catalog task activity and loop back to it multiple times.  I ended up using a Run Script activity to create the tasks.