cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bruce_in_Bucks
Frequent Visitor

Approval Flow to send messages to all at once

My Flow, in Teams using 365-ProPlus, gets a name and other details from a SharePoint list, which sends an email to the Approver requesting them to click on 1 of 3 "Custom Responses - Wait for one response"" ("Completed", "Completed with changes" or "Not Completed"). Then Updates the SharePoint list with the selection, and "Responses Comments" and "Response Responses date" from the Approval.

 

In testing, the Flow sends the first email but does not send the second until the first is completed. My List has 180 lines for 42 users (that is, many users have more than one line to Approve. I tried to add 2 Parallel paths to the first and so it sends 3 messages and will not send the 4th until the 1st if done so not much better.

 

btw; We've hit the MS bug trying this with Adaptive Cards ("Unable to reach App. Please try again.") which looks better and sends all at once, but just fails to return data back to SharePoint.

 

I'd love to hear from you as I'm sure this should be possible to fix.

Thanks in advance,

1 ACCEPTED SOLUTION

Accepted Solutions

Hi again!

"So I've tested with a parallel flow line and it duplicates the execution of the flow. That is, Line 1 of the SP list is sent down both of the parallel approval flow lines. "

I assume you have an array assigned to your 'Apply to each' with all the items you need to approve, right?

If you add a paralel flow line, with one 'Apply to each' per paralel branch, then you need to split the input array in two: half of the array assigned to first paralel branch, the other half to the second 

 

"Anyway, the work is due to management this afternoon and I will split my SP list into 4 lists of less than 50 rows each "

So, my first suggestion (activate paralel execution inside 'Apply to each' works fine, right? Congrats! I think the workaround you applied is the most reasonable one taking into account you need to provide the results asap.

 

"I will try Nested and Child when I have time but I'm worried about the complexity of passing HTTPS back and forth."

Please take into account if you need to get the Approval result back to your parent flow, this approach will not work. But, if your requirements allo you to implement your parent flow in a way it launches N child flows and stops executing, so each child flow run on its own and do not need to report back to parent flow, then this approach will be extremely useful, since you will not need to split your array of "items to  be approved".

 

Anyway, I was just thinking this spliting in subarrays with less than 50 items can be done by means of a couple of variables and a Do-Until loop to be added just before your 'Get items'.... so if you build an array of arrays (in your example an rray with 4 elements, these four elements are also arrays with less than 50 items), you can have two nested 'Apply to each' (one inside the other), and try to see if both nested 'Apply to each' be configured for paralel execution

 

Hope this helps

 

 

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

5 REPLIES 5
efialttes
Super User
Super User

Hi!

You "Approval" logic is inside an "Apply to each", right?

If so, you need to activate paralel execution. By default, 'Apply to each' iterations are executed sequentially

http://johnliu.net/blog/2018/2/serverless-parallelism-in-microsoft-flow-and-sharepoint

Please note max degree of concurrency is 50, so you will need to use a hybrid approach (paralel branches + 'Apply to each' paralel execution

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Hi!

Another approach is to split your flow in two:

Parent flow + n Approval Flows

So you move the individual approval logic to the second flow (Approval Flow), then you invoke this second flow from your Apply to Each in your first flow without waiting for its response, meaning your first flow will not need to wait for the response to invoke Approval Flow again and again

 

The functionality I am referring to is called Child Flows, I think it is premium and you need CDS license also. Check this link and the video:

https://flow.microsoft.com/en-us/blog/helpful-tips-for-using-child-flows/

 

The old fashioned Nested Flows is also premium, but you do not need CDS

https://flow.microsoft.com/en-us/blog/build-nested-flows/

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Thanks so much for the quick responses,

 

So I've tested with a parallel flow line and it duplicates the execution of the flow. That is, Line 1 of the SP list is sent down both of the parallel approval flow lines. 

 

Is that something you're familiar with and easy to avoid?

 

Anyway, the work is due to management this afternoon and I will split my SP list into 4 lists of less than 50 rows each and duplicate the approval as it takes 5 minutes to create as I've re-typed it that many times trying to iron out the bugs. That get's April month-end done and I'll keep looking in May. Actually, I was just re-reading my response and I could add an ID to each row of 1, 2, 3 or 4 to direct down 4 switch paths where each can handle 50 concurrent Approvals. 

 

I will try Nested and Child when I have time but I'm worried about the complexity of passing HTTPS back and forth.

 

Thanks again,

Hi again!

"So I've tested with a parallel flow line and it duplicates the execution of the flow. That is, Line 1 of the SP list is sent down both of the parallel approval flow lines. "

I assume you have an array assigned to your 'Apply to each' with all the items you need to approve, right?

If you add a paralel flow line, with one 'Apply to each' per paralel branch, then you need to split the input array in two: half of the array assigned to first paralel branch, the other half to the second 

 

"Anyway, the work is due to management this afternoon and I will split my SP list into 4 lists of less than 50 rows each "

So, my first suggestion (activate paralel execution inside 'Apply to each' works fine, right? Congrats! I think the workaround you applied is the most reasonable one taking into account you need to provide the results asap.

 

"I will try Nested and Child when I have time but I'm worried about the complexity of passing HTTPS back and forth."

Please take into account if you need to get the Approval result back to your parent flow, this approach will not work. But, if your requirements allo you to implement your parent flow in a way it launches N child flows and stops executing, so each child flow run on its own and do not need to report back to parent flow, then this approach will be extremely useful, since you will not need to split your array of "items to  be approved".

 

Anyway, I was just thinking this spliting in subarrays with less than 50 items can be done by means of a couple of variables and a Do-Until loop to be added just before your 'Get items'.... so if you build an array of arrays (in your example an rray with 4 elements, these four elements are also arrays with less than 50 items), you can have two nested 'Apply to each' (one inside the other), and try to see if both nested 'Apply to each' be configured for paralel execution

 

Hope this helps

 

 

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Thanks again for taking the time to look at this. I need to distribute the approvals tomorrow so I'll manually create 4 lists of less than 50 rows and make 4 versions of my flow then run them to complete the task (with manual intervention Thursday) to be reported next week.

 

I didn't use an array so it didn't work but I can see where/how to change it from your reply.

 

A lot of time has been taken up managing expectations because half the users will receive an Actionable Email and half won't, so they will need to navigate to the Approvals page in Power Automate.

 

Many thanks, I'm sure I'll be back as we push the boundaries of our new automated process.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,849)