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

5 REPLIES 5
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.

wbroens
New Member

Hi,

 

This is possible by using a ";" between your matches.

 

So:

SwitchFormulaMatch1;Match1b;Match1cResult1 [, Match2Result2, ... [, DefaultResult ] ] )

 

gr

 

Wim

markfleet
Advocate II
Advocate II

Hi @wbroens. Is that a new feature? Its not working yet for me in authoring version 3.22061.6.

For some reason it is not working for me now. I think I was mistaken and made wrong assumption it worked.

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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