web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Multiple matches in sw...
Power Apps
Unanswered

Multiple matches in switch statement evaluate to same result

(3) ShareShare
ReportReport
Posted on by 1,207

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?

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @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."

  • Digital Profile Picture
    1,207 on at

    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 Profile Picture
    4 on at

    Hi,

     

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

     

    So:

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

     

    gr

     

    Wim

  • markfleet Profile Picture
    108 on at

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

  • wbroens Profile Picture
    4 on at

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

     

  • ErwanF Profile Picture
    94 on at

    Yes you are correct, the semicolon solution will only take the first match value and then ignore the following code.

     

  • Manish MISTRY Profile Picture
    2 on at

    try Switch(true, match1astrue or match2astrue or match3astrue, effectfor12and3.....)

  • SamBou Profile Picture
    12 on at
    Unlike what @mdevaney said, it is absolutely one of the purposes of a Switch statement to allow for multiple matches.  This is the case in many programming languages and should be added to Power Apps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard