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

Parallelism fails for paarovals nested in 'Apply to each'

Hi,

 

Approvals work fine with single level of 'Apply to Each' parallelism on. When approval action is in a nested 'Apply to Each' (parallelism turned on for both outer and inner loops), the loop cycles are not going on.

 

Issue can be reproduced in a simple flow;

  • Create array variable (let's call it outer) with 2 items: outerloopA, outerloopB
  • Create another array (let's call it inner) variable with 2 email addresses: usera@contoso.com, userb@contoso.com
  • Create outer 'Apply to Each' and process outer variable. Turn on concurrency.
    • Create inner 'Apply to Each' within first one and process inner variable. Turn on concurrency. Add an action to send approvals
      To: inner variable
      Subject: outer variable

 

Expected outcome from above sample flow:

  • Each user receives 2 approvals (with outerloopA and outerloopB subjects)

 

Real outcome:

  • usera receives 2 approvals (with outerloopA and outerloopB subjects)
  • userb receives an aprroval only when usera responds to an approval

 

So concurrency setting is only applied first item of outer loop, then behaves like first cycle of outer loop completed and moves on to next outer cycle. Changing "approval type" between anyone/everyone does not change the behavior.

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Parallelism fails for paarovals nested in 'Apply to each'

Hi @UnprayingMantis,

 

It seems that you enabled Concurrency Control of Apply to each.

Using the concurrency control settings in for each loops can make sure all of the approvers receiver their request at the same time.

Have you bumped the degree of parallelism to the maximum?

I have made the following test.

In my scenario, I am going to get all the items in the list, then send an email with the details of a multiple selection enabled Choice column. A nested apply to each will be automatically created. A screenshot likes below. By the way, I have enabled the concurrency control and set it value to the maximum.

When the flow is triggered, it will send an approval email to both the two email addresses at the same time.

1.PNG

The issue you mentioned could not be reproduced by me.

Please share a screenshot of your flow to help reproduce.

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: Parallelism fails for paarovals nested in 'Apply to each'

Hi Mabel,

 

Here is screenshot to repro the issue:
nestedflow1.jpgnestedflow2.jpg

 

regards,

Umut

Highlighted
Frequent Visitor

Re: Parallelism fails for paarovals nested in 'Apply to each'

Hi,

 

Any comments on the behavior?

Highlighted
Post Prodigy
Post Prodigy

Re: Parallelism fails for paarovals nested in 'Apply to each'

Hi , 

 

Instead of using Set variable inside loop use compose action. the expression that you are using to set variable can be used in compose as well. 

 

Ref: https://toonvanhoutte.wordpress.com/2018/02/20/variables-in-parallel-for-each-loops/comment-page-1/?...

 

Thanks

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (10,335)