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

Is it possible to do SWITCH with OR logic inside

Hi,

 

We try to build a flow using switch for different logics.

 

However, there are certain cases, 2 different input will have same outcome.

 

For example:

 

If type=A, use logic 1

If type=B, use logic 2

If type=C, use logic 2

If type=Other, use logic 3

 

Instead of create seperate case, can we do as below?

If type=A, use logic 1

If type=B OR C, use logic 2

If type=Other, use logic 3

 

Thank you!

2 ACCEPTED SOLUTIONS

Accepted Solutions
Gristy
Resident Rockstar
Resident Rockstar

Hi Jackie,

 

To avoid duplication i would create a variable lets called it Path. 

 

Create a switch that sets Path to 1 or 2 or 3 as per your example.

Create a 2nd switch based on this variable to run the logic.

 

This way you do not have to duplicate/maintain the logic for the ones where it follows the same logic, and it easily expands to more values in the future.

View solution in original post

v-bacao-msft
Community Support
Community Support

 

Hi @JackieZhu ,

 

Currently, MS Flow does not support the use or logic in Switch.

If you feel that the same action is complicated to configure multiple times, you can try using Copy action.

Also, note that you may get some known errors by pasting the action directly in the Switch case.

You could copy the corresponding action to the steps below the Switch control, and then drag the actions to the specified case.

Hope it helps.

 

Best Regards,

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

3 REPLIES 3
ScottShearer
Super User III
Super User III

@JackieZhu 

The documentation suggests that you cannot use an OR in a case in a switch statement.

Y

 

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

Scott
Gristy
Resident Rockstar
Resident Rockstar

Hi Jackie,

 

To avoid duplication i would create a variable lets called it Path. 

 

Create a switch that sets Path to 1 or 2 or 3 as per your example.

Create a 2nd switch based on this variable to run the logic.

 

This way you do not have to duplicate/maintain the logic for the ones where it follows the same logic, and it easily expands to more values in the future.

View solution in original post

v-bacao-msft
Community Support
Community Support

 

Hi @JackieZhu ,

 

Currently, MS Flow does not support the use or logic in Switch.

If you feel that the same action is complicated to configure multiple times, you can try using Copy action.

Also, note that you may get some known errors by pasting the action directly in the Switch case.

You could copy the corresponding action to the steps below the Switch control, and then drag the actions to the specified case.

Hope it helps.

 

Best Regards,

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

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,561)