Start flow per record from a list action?

Jacob Saaby Nie
Tera Contributor

So, I want to mark a number of assets in a list.

Then I want to go to the list actions, choose an action, and from that trigger a flow that runs per record chosen in the list.

Any good ideas on how to do that?

4 REPLIES 4

Jacob Saaby Nie
Tera Contributor

PS: I know how to create list actions and all that jazz. Also, I know we can copy code from within flow designer, to trigger a flow.

I'm simply wondering: Which trigger type would I use for something like this? There doesn't seem to be any trigger that really fits the task!?

Dnyaneshwaree
Mega Sage

Hello @Jacob Saaby Nie ,

-Use the "For Each" action of the flow to iterate over each record in of previous lookup using condition to execute the required records.
Please refer below article for more info:
https://www.servicenow.com/community/developer-forum/flow-designer-how-to-use-the-resulted-list-of-l...
https://docs.servicenow.com/bundle/washingtondc-build-workflows/page/administer/flow-designer/task/c...
https://docs.servicenow.com/bundle/tokyo-application-development/page/administer/flow-designer/conce...

Dnyaneshwaree_0-1718198882648.png

 

Please accept my solution if it works for you and thumps up to mark it as helpful.

Thank you!!



Please accept my solution if it works for you and thumps up to mark it as helpful.
Thank you!!

Dnyaneshwaree Satpute
Tera Guru

Immediately after, I decided on another approach I think could work:

I use the list action to update a date field on the hardware record.

Then I have the trigger on the flow trigger on that date field being changed on the hardware record.

 

It would be beneficial though, that we had a list action and a trigger type in flow designer, so this scenario was just built right in.

Josh Pirozzi
Kilo Sage

Hi @Jacob Saaby Nie,

 

To provide a list and set the conditioning to perform a certain action based on the List Record selected, you'll want to use the 'For each' function. 

 

Once you add the 'For Each', add a Function (Fx) to it to Split each selected item from the List into its own record. I'd recommend using a comma between each selected record.

 

Then, add a 'Look Up Record' Step after the For Each and add the condition where SysID is the SysID on the For Each Step.

 

This should give you the ability to trigger different Flows, SubFlows and Actions based on the individual Record(s) selected from a List. You'll just need to add an 'If' Statement to break out each conditional trigger. 

 

I've detailed some of this out in https://www.servicenow.com/community/developer-forum/flow-designer-amp-list-collector-quot-for-each-...

 

Hope this helps!

 

Josh