cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Digital
Super User
Super User

Multiple matches in switch statement evaluate to same result

I've looked in the documentation which lists the general format of a switch statement as follows: 

 

SwitchFormulaMatch1Result1 [, Match2Result2, ... [, DefaultResult ] ] )

 

I want to be able to have multiple matches that produces the same match result

 

SwitchFormulaMatch1Match2, Match3, Result1 [, Match4Result4, ... [, DefaultResult ] ] )

 

Does anyone know if this already possible?

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@Digital 
This is already possible by writing an IF statement.  It is not the purpose of SWITCH.

If(
    Condition1=true Or Condition2=true Or Condition3=true, Result1,
    Condition4=true, Result2
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

2 REPLIES 2
mdevaney
Super User
Super User

@Digital 
This is already possible by writing an IF statement.  It is not the purpose of SWITCH.

If(
    Condition1=true Or Condition2=true Or Condition3=true, Result1,
    Condition4=true, Result2
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Hey @mdevaney ,

 

Thanks for the reply, I know I can do that with an If statement but other languages allow switch using multiple matches evaluating to same result. I suppose it's a nice to have rather than something that is necessary.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,912)