For each loop in workflow

anthonyt1
Kilo Contributor

Good morning,

So basically I'm trying to setup a workflow, where in the order guide, I have a function to allow a user to add multiple "items" to one RITM. I then need each "item" to spawn a task. Is there an easy way to do this, kind of like making each "item" a member of an array and looping through the array to spawn tasks, then waiting for all those tasks to close before moving onto the next step in the workflow? If anyone has seen a guide or tutorial they can point me to for this kind of problem that would be great, or where to look, because I haven't found much on my own.

Thanks

1 REPLY 1

Brad Tilton
ServiceNow Employee
ServiceNow Employee

HI Anthony,



This is pretty common, and usually consists of a run script activity in your workflow that generates the necessary tasks programmatically then a waits for activity where you can wait for all of those tasks to close.