cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Dorul
Level 8

Switch cases - Approval

Hello,

Seeking your advice. I try and manage to create a simple approval flow based on 2 radio buttons choices in Sharepoint.

Which i can make it work in this way, but I bet it must be an easier solution. Basically I dont want to create 2 approval stages, for each switch case, but instead I want a single approval that knows whos the approver depending on the selection. Maybe some kind of Assign function, assign selected choice to an e-mail.

For example, if the client is from East, my flow will know when i select EAST to send the approval to abc@xyz.com, and so on.

For 2 switch cases is not such a big deal to create multiple conditions with multiple approvers, but thats just for testing - as my final flow will have many more switch cases.

Thanks!

 Capture.JPG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Switch cases - Approval

Hi @Dorul,

 

You could modify the expression as below:

 

if(equals(variables('DEPART'),'EAST'),'Test1@xxxxxx.xxxxxxxxxxx.com',if(equals(variables('DEPART'),'WEST'),'Test2@xxxxxx.xxxxxxxxxxx.com','Test3@xxxxxx.xxxxxxxxxxx.com'))

 

The expression means if the value is equal to EAST, the approval would be sent to Test1,

If the value is equal to WEST, the approval would be sent to Test2,

else if the value is not equal to EAST,also not equal to WEST,the approval  would be sent to Test3.

 

 

Please take a try on your side and let me know if your problem could be solved

 

 

Best regards,

Alice

Best regards,

Alice

View solution in original post

6 REPLIES 6
Community Support Team
Community Support Team

Re: Switch cases - Approval

Hi @Dorul,

 

I have made a test on my side and I afraid that it is difficult to reallize your requirement if you don't offer the data with the relationships between each client and the approver such as an excel data statistics or a sharepoint data statistics.

 

And you could simplify your flow as below to achieve your requirement,I afraid that it is a easiest way to achieve your requirement and you don't need to provide a data statistics with the relationships between each client and the approver.

 

Capture.PNG

 

Best regards,

Alice

Dorul
Level 8

Re: Switch cases - Approval

Thanks for the answer. I found something but i cant adapt to my situation.

 

if(equals(triggerBody()?['Branch']?['Value'],'East'),'Test1@xxxxxx.xxxxxxxxxxx.com','Test3@xxxxxx.xxxxxxxxxxx.com')

in:

https://powerusers.microsoft.com/t5/Building-Flows/Assign-Approval-to-User-based-off-a-Value-in-a-Sh...

Wondering if i can add 2 if statements in the same field (in Start an Approval - field: Assigned to) and if yes how it would be?

If Department is EAST, send mail to test1@xyz.com, if DEPART is WEST, test2@xyz.com. I tried a few times but expressions that i tried are invalid 🙂

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





Community Support Team
Community Support Team

Re: Switch cases - Approval

Hi @Dorul,

 

Could you please share a screenshot of the configuration of your flow?

 

If you have add a variable to save the data, you should create a flow as below:

Capture.PNG

 

The expression in the flow as below:

if(equals(variables('GEPART'),'EAST'),'Test1@xxxxxx.xxxxxxxxxxx.com','Test3@xxxxxx.xxxxxxxxxxx.com')

 

Best regards,

Alice

 

 

 

 

Dorul
Level 8

Re: Switch cases - Approval

Thank you very much for your patience @v-yuazh-msft 🙂

I created and deleted flows several times, different tries with different approaches.

I created again like in your printscreen - so now, basically, can you please adjust that expression to my needs if i have, lets say, 3 choices in Sharepoint list to choose from: EAST, WEST and SOUTH.

See the printscreens with the list that i made for testing and also the flow:

Sharepoint.JPGSharepoint2.JPGFlow.JPG

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





Community Support Team
Community Support Team

Re: Switch cases - Approval

Hi @Dorul,

 

You could modify the expression as below:

 

if(equals(variables('DEPART'),'EAST'),'Test1@xxxxxx.xxxxxxxxxxx.com',if(equals(variables('DEPART'),'WEST'),'Test2@xxxxxx.xxxxxxxxxxx.com','Test3@xxxxxx.xxxxxxxxxxx.com'))

 

The expression means if the value is equal to EAST, the approval would be sent to Test1,

If the value is equal to WEST, the approval would be sent to Test2,

else if the value is not equal to EAST,also not equal to WEST,the approval  would be sent to Test3.

 

 

Please take a try on your side and let me know if your problem could be solved

 

 

Best regards,

Alice

Best regards,

Alice

View solution in original post

Dorul
Level 8

Re: Switch cases - Approval

You`re the best! But you knew that already 🙂

Thank you!!





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,845)