For each loop to check group approval in flow designer

MS17
Tera Contributor

Hi All,

 

I have a requirement to review the group annually, if group has no manager or manager is inactive, we need to trigger approval to "admin" group, if anyone from this group is rejected, then deactivate that group, if approved keep it active, if no action taken, then wait for 5 days and trigger reminder notification, still no response, then the group should be deactivated.

 

I created a scheduled flow to trigger every year,  I created group approval record for each group which has no manager or manager is inactive, now i need to check if anyone from the group is approved/rejected for each group approval record, can anyone help me                        

 
 
 
 

1.png2.png

1 ACCEPTED SOLUTION

Hello @MS17 ,

Create a new flow variable

Subflow add 01.png

 

Add Do the Following in Parallel as 3rd step, then followed by Ask For approval and then if Statements. Inside If, set the flow variables...

Subflow add 02.png

and then set the value of same flow variable in case approved within due date

Subflow add .png

 Then in parallel Branch, add wait for duration and then IF action followed by Fire Event as per your case.

Subflow add 03.png

Hope this helps!

View solution in original post

16 REPLIES 16

Ankur Bawiskar
Tera Patron

@MS17 

Why are you not using Ask for Approval OOTB flow action?

after the Ask for approval you can check whether the approval was Approved/Rejected and based on that take next action

💡 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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar , 

I tried Ask for Approval also, but inside for each, once group approval triggered, it is waiting for approved/rejected for the group, then only the approval triggering for next group, but i want to trigger group approval at a time for all the groups matched with the condition

 

Thanks.

 

@MS17 

so you want parallel approval

there are challenges when parallel approval comes into flow.

when you use "Do the following in parallel" flow logic and use multiple "Ask for Approval" then Decision from 1st approval is being applied to all the approvals

see these blogs and the KB from ServiceNow with a workaround

Parallel Approvals in Flow Designer 

Parallel Approvals in Flow Designer 

the below KB talks about the issue you are facing and a possible workaround

Using Parallel Approvals in Flow Designer is only respecting the Approval Decision of the First Appr...

💡 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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar 

I checked the links which you have given, in that it was mentioned to created task record before Ask for Approval, but in my case it is dynamic, i might get many groups and i need to iterate each group record, how it will work?