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

Switch Case is not working properly

Hi,

 

I would like to seek your advise regarding my switch case situation, wherein an action from Case 1 is not continuing to Case 2. Flow is ending the process as successful even though the process should continue and switch to Case 2.

 

Scenario:

Switch-Case condition is when task_no = Completed

Case 1 = task1

Case 2 = task2

Case 3 = task3

Case 4 = task4

Case 5 = task5

Default (If no case contains a matching value), set task_no variable to Completed

 

All cases sends an approval email/item to user. When item is approved, will switch to Case 2, so on and so forth.

 

Expected result:  When approval item is approved and all the actions in Case 1 is satisfied, the variable  task_no will be set to task2, hence, switch to Case 2.

 

Actual result: The variable task_no is set to task2 but Flow will end the process on Case 1 with status as Succeeded and will not switch to Case 2.

 

I have observed that this issue occurred when an approval email is sent and approved after a day or more. But when approval email is approved within the day it was sent, the Case 1 was able to switch to Case 2.

 

Below is the screenshot for your reference. The workflow ran on March 25, 2020 and the approval item was approved earlier this morning. 

 

Case 1 processCase 1 process

 

Case 1 processCase 1 process

 

Case 1 processCase 1 process

 

Case 1 process,Case 1 process,

 

Switch Case 2.PNG

 

 

I think this is a bug since it never happened before.

 

Please advise on this issue. Hope to hear from you soon.

 

Kind regards,

ysm

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Switch Case is not working properly

Hi @ysm ,

 

I suggest that you could update the do until to Task_no equal task2 in the Do until.

And add anther Do until 2, Task_no equal task 3 in the Do until 2.

And anther Do until 3, Task_no equal task 4 in the Do until 3.

And the last check the Task_no equal Compeleted.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
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

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Switch Case is not working properly

Hi @ysm ,

 

It is the expected behavior since only one case would run in the switch case.

and if you want the case 2 would run after the case 1 runs, you could only add a switch 2 under the switch1.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
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: Switch Case is not working properly

Hi @v-alzhan-msft,

 

I forgot to mention that I am using the Switch-Case inside Do until. Kindly see image below for your reference.

 

Do until.png

 

We are using this logic for a couple of months and worked perfectly fine until this issue occurred last week. Please advise.

 

Kind regards,

ysm

 

 

Highlighted
Community Support
Community Support

Re: Switch Case is not working properly

Hi @ysm ,

 

I suggest that you could update the do until to Task_no equal task2 in the Do until.

And add anther Do until 2, Task_no equal task 3 in the Do until 2.

And anther Do until 3, Task_no equal task 4 in the Do until 3.

And the last check the Task_no equal Compeleted.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
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
Frequent Visitor

Re: Switch Case is not working properly

Hi @v-alzhan-msft,

 

Thank you for your suggestion, however, it will not fit on the process once the approval email is rejected. Could you please look at the Do until and see what has gone wrong? This was working perfectly fine 2-3 weeks ago.

 

Thank you.

 

Kind regards,

Ylarra Sta. Maria

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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 (13,002)