How to pass values from a For Each loop into an array flow variable (step by step)?

saint
Tera Expert

Hi Community,

 

I’m working in ServiceNow Flow Designer and I’m trying to clearly understand the correct, supported way to collect values from a For Each loop and store them into an array flow variable, so the values are available after the loop finishes.

 

What I’m trying to do
Use Look Up Records (or similar) to return multiple records
Loop through those records using For Each
Collect each record’s sys_id
Store all sys_ids into one array flow variable
Use that array later in the flow (outside the For Each)


Could someone please provide a clear, step‑by‑step example

1 REPLY 1

Tanushree Maiti
Kilo Patron

Refer this: 

https://www.servicenow.com/community/workflow-automation-forum/flow-designer-create-array-of-data/m-...

 

https://www.youtube.com/live/8ocmrYujQSE

Episode 25 - Complex Objects in ServiceNow Flow Designer

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: