Task creation in flow designer

Jesus Nava
Tera Guru

Hello experts please I need your support, I am creating a flow in which if a user gets terminated, a REQ-RITM-SCTASK are created.

At the moment I have this so far:

JesusNava_2-1664992008615.png

 

Here is my issue, when the user has for example 3 assets assigned, it creates 3 sctasks, but there are some exceptions in which the user has more than 10, so I wouldn't want to have 10 sctasks created, how can I fix it in a way that only one task is created with all the asset information? instead of the way I'm having ot now

 

Appreciate your help

7 REPLIES 7

bshiddy
Mega Contributor

I'm no SNOW developer, but just looking at your flow/logic, I would recommend that you move your 'create SCTASK' out of your foreach (asset) loop. The create SCTASK needs to live outside of that loop. Use the foreach loop to build an array of the assets that will be added to your singular SCTASK.

Thank you!

asifnoor
Kilo Patron

Hi,

You can simply move the create task activity outside of the for loop. Indent it to the left so that it is not part of your loop. Let the loop fetch you all the asset information into a variable, then use the create task activity to populate those variable in the description of the task.

 

Mark the comment as a correct answer and also helpful if this helps to solve the problem.

Will try that and see the results Asinfoor,

Regards