cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver III
Resolver III

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
Highlighted
Community Support
Community Support

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
Highlighted
Community Support
Community Support

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

Highlighted
Resolver III
Resolver III

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!





Highlighted
Community Support
Community Support

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

 

 

 

 

Highlighted
Resolver III
Resolver III

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!





Highlighted
Community Support
Community Support

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

Highlighted
Resolver III
Resolver III

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
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (5,101)