cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Conditional multiple approvals

I want to be able to send email approvals dynamically depending on what answer the user puts in the question.

This question is quite literally, "pick all people that apply"

ay2_0-1593193021422.png

 

So they can pick 1, any 2, any 3, or all 4 options available - and in turn the flow would be able to look at these answers and send an email depending on what they choose above. What is the best way to achieve this? 

 

Thanks!

5 REPLIES 5
Highlighted
Microsoft
Microsoft

Re: Conditional multiple approvals

You could use a switch case.  This should solve your issue.

 

https://community.dynamics.com/365/b/d365demystified/posts/switch-case-in-a-flow-power-automate

Highlighted
Helper II
Helper II

Re: Conditional multiple approvals

Hi @mcin9781 

 

I am familiar with switch cases and use them in other parts of the flow, but since each case requires an "Equals" how do I handle all the permutations that the user can pick? 

1) Person 1

2) Person 2

3) Person 3

4) No one

5) Person 1, Person 2

6) Person 1, Person 3

7) Person 2, Person 3

😎 Person 1, Person 2, Person 3

 

Since this is a multiple answers question on the form, I need to account for all of these. I checked if my variable equals Person 1, Person 2 but when I test it, it fails that switch case. Any thoughts?

Highlighted
Helper II
Helper II

Re: Conditional multiple approvals

@mcin9781 

ay2_0-1593433688345.png

Here is a screenshot of what it looks like. There's two switch cases, it enters the first case (green) perfectly fine, but the Orange highlight in variable "a" doesn't seem to like it on switch 2. Always goes to default case

Highlighted
Super User III
Super User III

Re: Conditional multiple approvals

@ay2 

I suggest that the answer to your question depends on what type of approval you intend to create.  Do you want to have a separate approval action for each individual selected?  If so, then create an array of approvers and put your approval inside of a loop.  You'll loop through each element in an array.  Also, you'll need to set concurrency control to On for the loop - that way the approvals will execute in a parallel fashion rather than sequentially.

If you want a single approval set to All must approve, then create a semicolon delimited string of the email addresses of the individuals who have been selected.  Use that string for the approver.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Highlighted
Helper II
Helper II

Re: Conditional multiple approvals

@ScottShearer 

 

Thanks for your response. So the answer is that each person in the screenshot (Person 1, Person 2, Person 3) is someone that CAN be selected for approval. It could be any combination of people, but whoever is selected HAS to be sent an approval message. So in the previous picture I posted, I counted a total of 8 permutations so I figured there would need to be 8 cases in a switch control. I tried creating an array of the approvers, but when I run the flow it says the options the user selects are only of type string and can't be put in an array. Since the form itself is a "multiple answer" choice question, I somehow can't reference each person. I think if i knew how to do that I would be golden. Maybe i'm not understanding the delimited string, as I also tried to use the semicolon as the "equals" in the switch case. In that situation, a screenshot of an example would be very helpful.

 

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
Top Kudoed Authors
Users online (7,991)