Task creation in flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2022 10:47 AM
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:
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2022 10:57 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2022 12:32 PM
Thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2022 11:33 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2022 11:46 AM
Will try that and see the results Asinfoor,
Regards