Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Approval using for each in flow design

2022_ServiceNow
Tera Expert

Hi All,

There's a variable with type as list collector, users can select multiple servers. Based on the servers selected, it should trigger the approval for the server owner. I have a flow design along with the subflow.

This is in the flow:

2022_ServiceNow_0-1699512718858.png

This is the subflow:

2022_ServiceNow_1-1699512770862.png

2022_ServiceNow_2-1699512799093.png

 

2022_ServiceNow_3-1699512822911.png

After submitting the request, in the flow context:

2022_ServiceNow_4-1699512878869.png

 

Please help me in resolving this issue. Thanks in advance.

@Ankur Bawiskar @Sandeep Rajput @Dr Atul G- LNG @Hemanth M1 @pavankumar17 @Anurag Tripathi @AshishKM 

 

 

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

@2022_ServiceNow 

you are saying it's sending approval to correct server owner then what's the issue?

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

@Ankur Bawiskar 

No, when I test the subflow using test button above, it's showing the proper sys_id of the server owner.

But there is some issue in the for each, even though I have selected multiple servers in the portal while submitting the request, it's showing 0 of 0 and no approvals are triggered in the RITM

2022_ServiceNow_1-1699513686816.png

 

2022_ServiceNow_0-1699513579066.png

Can you please help me with this?

Tai Vu
Kilo Patron
Kilo Patron

Hi @2022_ServiceNow 

Let's put a Look up records before the step For Each [5], where we'll query to get Servers records with the condition "Sys ID is one of <server_list_collector_variable>".

Then update the input of the step For Each to the Servers Records result above.

Sample below.

TaiVu_0-1699520899264.png

 

 

Cheers,

Tai Vu

@Tai Vu ,

I'm not able to get input from step 5 to 'for each'

2022_ServiceNow_0-1699521126155.png