cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JD2301
Level: Powered On

Send Multiple Approval Emails in a For Each all at once.

Hi Guys,

I have created a flow which sends a row from my excel online TimeSheet document to be approved/rejected via email.
This works fine but if I am adding 5 rows for approval at the same time, flow is only picking the first row and waiting until that is approved/rejected before the next row will send for approval.

How can I edit my flow to send seperate approval emails for each row at the same time, rather than waiting until row 1 is approved before sending row 2?

I have used the 'Start and wait for an approval' action.

 

Many thanks,
JD.Flow1.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Send Multiple Approval Emails in a For Each all at once.

Hi @JD2301 ,

 

Do you want to send approval emails for each item at the same time?

 

Please try to turn on the Concurrency Control of the Apply to each, and set its Degree of Parallelism to 50 under Settings.

 

Then all the approvals will be sent at the same time.

 

Please check the following images for a reference.

1.PNG2.PNG

 

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.

View solution in original post

Community Support Team
Community Support Team

Re: Send Multiple Approval Emails in a For Each all at once.

Hi @JD2301 ,

 

Please consider using parallel branches and nested condition in the flow.

 

I have configured the flow likes below for your reference.

 

For testing, I’ve just added two parallel branches for 0-250 and 250-500. The similar configuration for 500+.

Add button trigger.

 

List rows present in a table.

 

Add Apply to each, and a Condition within the Apply to each.

Configure the condition with the following code:

 

and(greater(int(items('Apply_to_each')?['number']),0),lessOrEquals(int(items('Apply_to_each')?['number']),250))

is equal to

True

 

Under if yes branch, send the approval to supervisor.

 

Add parallel branch by clicking the plus icon under action List rows present in a table. Then add Apply to each 2, add Condition 2 within Apply to each 2 and configure it with the following code:

 

and(greater(int(items('Apply_to_each_2')?['number']),250),lessOrEquals(int(items('Apply_to_each_2')?['number']),500))

is equal to

True

 

Under if yes branch, start an approval to supervisor.

Add Condition 3 to check if the Response is equal to Approve. Under If yes branch of Approval 2, send the approval email to Manager.

 

Images for your reference.

1.PNG2.PNG

 

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.

View solution in original post

6 REPLIES 6
Community Support Team
Community Support Team

Re: Send Multiple Approval Emails in a For Each all at once.

Hi @JD2301 ,

 

Do you want to send approval emails for each item at the same time?

 

Please try to turn on the Concurrency Control of the Apply to each, and set its Degree of Parallelism to 50 under Settings.

 

Then all the approvals will be sent at the same time.

 

Please check the following images for a reference.

1.PNG2.PNG

 

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.

View solution in original post

JD2301
Level: Powered On

Re: Send Multiple Approval Emails in a For Each all at once.

Hi @v-yamao-msft 

I have just tried this but it didn't work for me. Is this because you used 'List of Rows Present In A Table' and I am using 'Get a row'?

flow3.png

Yes, I want to send all approvals at the same time. I have set my flow up so if the 'Send For Approval' column has 'Yes' entered into it, an email will send out to the approver asking to approve or reject. So if I have 10 items all with send for approval as Yes, I want them all to be sent for approval at the same time. At the moment it will only send the first item, wait until that has been approved and then send the second... and so on. This doesn't really work becuase if the approver isnt available to approve at the time the email gets sent, then not only do they get recurring email messages with duplicated info on asking to approve, but the rest of the items are still sat waiting to be sent.

 

Any advice would be greatly appreciated.

 

Thanks.

Super User
Super User

Re: Send Multiple Approval Emails in a For Each all at once.

Hi Jonny, yes this can be done with an array variable so that just a single email gets sent but there are a few issues that I haven't found a way round yet.

What I've done is to add an extra column in my spreadsheet for "Submitted" which will be a yes or no answer.

1. Add a recurrence schedule.

2. I've got my spreadsheet in a SharePoint document library, so add an excel action for "List Rows Present in a table".

3. Initialize a variable and set its type to array.

4. Add a condition for  submitted is equal to no. It will wrap it in an Apply to each and you select "value" from the dynamic content.

5. Leave the red if no channel empty

6. In the green if yes channel add an append to array varible, select the variable you created from the dropdown and in the value I've entered the week and hours columns [this is the first issue].

7. Outside the apply to each, add a  Create HTML Table action and set the from to be the output from the variable.

8. I've made the Header "Week" and the value is an expression item() from the expressions tab on the right.

9. Add a Create an Approval (v2) and in the details select the output from the HTML table.

You can then delete the row in the spreadsheet as in your flow or update the submitted rows from no to yes.

The main issue is that even using Select I haven't yet found a way to format the output of the table in the approval email.

I'll keep working on it as I'd like to get the email table nicely formatted.

Rob
Los Gallardos

1-recurrence-listRows-initVar.png2-Condition-Append.png3-createHTML-Approval.png4-email.png

JD2301
Level: Powered On

Re: Send Multiple Approval Emails in a For Each all at once.

Hi @v-yamao-msft ,

I just modified my flow so it was had te same actions as yours and it worked perfectly.

I have another question about the approval part.. In my timesheet I need the approvals to go to different people based on the value.
£0 - £250, it needs to go to just 1 approver (Supervisor)
£250-£500 = 2 approvers (Supervisor first, if they approve then it needs to go to the manager to approve)
£500+ = 3 approvers (Supervisor, if approved then to Manager, if approved then onto the CEO)

I have this all set up in my Excel sheet, I just can't figure out how to set my flow up so this happens! Any help please?

Thanks.

Community Support Team
Community Support Team

Re: Send Multiple Approval Emails in a For Each all at once.

Hi @JD2301 ,

 

Please consider using parallel branches and nested condition in the flow.

 

I have configured the flow likes below for your reference.

 

For testing, I’ve just added two parallel branches for 0-250 and 250-500. The similar configuration for 500+.

Add button trigger.

 

List rows present in a table.

 

Add Apply to each, and a Condition within the Apply to each.

Configure the condition with the following code:

 

and(greater(int(items('Apply_to_each')?['number']),0),lessOrEquals(int(items('Apply_to_each')?['number']),250))

is equal to

True

 

Under if yes branch, send the approval to supervisor.

 

Add parallel branch by clicking the plus icon under action List rows present in a table. Then add Apply to each 2, add Condition 2 within Apply to each 2 and configure it with the following code:

 

and(greater(int(items('Apply_to_each_2')?['number']),250),lessOrEquals(int(items('Apply_to_each_2')?['number']),500))

is equal to

True

 

Under if yes branch, start an approval to supervisor.

Add Condition 3 to check if the Response is equal to Approve. Under If yes branch of Approval 2, send the approval email to Manager.

 

Images for your reference.

1.PNG2.PNG

 

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.

View solution in original post

Highlighted
JD2301
Level: Powered On

Re: Send Multiple Approval Emails in a For Each all at once.

Hi @v-yamao-msft 

Yes I got this all figured out now, it works perfectly. 

Although the recurrence trigger works for me currently, I have been looking to see if there was another option to trigger the flow. It would be better if the flow started once an entry is made into the excel sheet and the column 'Send for Approval' is marked as 'Yes', rather than on a timer....But I can't see any triggers like this. Do you know if there is anything like this available?

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 330 members 5,294 guests
Please welcome our newest community members: