flow designer script

chandan2212
Tera Contributor

Hi All,

 

I am getting two or more sysid via flow varible in the flow designer,  I neded to pass one by one sysid in the another subflow flow along with group name , but it takeing only first sysid other sysid is not taking .I have designed using the for each records , can anyone advise me how to achive this requirement.

 

if the  receive  5 sysid is than 5 times subflow should run can anyone advise me how to do it .

 

 

Thanks and Regards,

Chandan Patra

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@chandan2212 

why not pass complete string and then in Subflow iterate?

You can't have flow variable of type Array and hence you can't iterate that

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@chandan2212 

another way is

-> pass that string of 5 sysIds to custom flow action as input

-> in that use script step and convert that to array of string

-> then return this output from action to main flow and then iterate that array using For Each

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@chandan2212 

Hope you are doing good.

Did my reply answer your question?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

debendudas
Mega Sage
Mega Sage

Hi @chandan2212 ,

 

 

Based on my understanding, you want to run parallel sub-flows for each record.


To achieve this, you can use a combination of For Each and Dynamic Flow, as shown below:

 

debendudas_0-1765865509280.png

 

How it works:

  • The For Each loop will iterate through all your records.
  • For each record, a Dynamic Flow will trigger the corresponding sub-flow in parallel.

 

If my response helped you, please consider marking it as "Accept as Solution"‌‌ ✔️ and "Helpful👍 ‌‌.
Doing so makes it easier for other community members to find the right answers and helps strengthen our community.