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 Automate / Switch Equal expressio...
Power Automate
Unanswered

Switch Equal expression with multiple values

(0) ShareShare
ReportReport
Posted on by 146

Hello,

I am using the Switch function and have a Case that can be multiple options. What is the best expression I can use for this?

Can equal either one:

504

525 

513 

 If so, send to Value = email address

knandez05_2-1618867823092.png

Thank you in advance!

 

 

 

C

Categories:
I have the same question (0)
  • henkenTech Profile Picture
    135 on at

    Hey there - to my knowledge, Switch cases can only compare single values using "equals" as a comparator. "Contains" is not supported. 

     

    To do this, you could nest test switch case inside one of the branches of a condition. Use the "contains" comparator in the condition to catch the one case with several values and deal with the rest using the switch case.

     

    Max

  • knandez05 Profile Picture
    146 on at

    Thank you for the response @henkenTech 

  • henkenTech Profile Picture
    135 on at

    @knandez05 wrote:

    Thank you for the response @henkenTech 


    Please mark your question is solved if this was your solution. Thank you 😊

  • VictorIvanidze Profile Picture
    13,073 on at

    Use this instead of Case:

     

    or(or(equals(variables('numvar'),504),equals(variables('numvar'),525)),equals(variables('numvar'),513))

  • Paulie78 Profile Picture
    8,422 Moderator on at

    I would personally use a totally different method, especially if the number of conditions is going to grow. I would make a JSON array like this:

    [
     {
     "value": "504",
     "email": "paul@paul.com"
     },
     {
     "value": "525",
     "email": "someone@somewhere.net"
     },
     {
     "value": "513",
     "email": "jim@enterprise.com"
     }
    ]

    Filter that array based on the value, and the take the email address. It's just cleaner and more scalable.

    Do you get where I am coming from?

  • ozhally Profile Picture
    16 on at

    I solved this by using an If statement on the switch.

    Something like this;

     

    If(And(condition1,condition2), case1,

    If(And(condition1,condition3), case2,

    If(And(condition2,condition3), case3,

    case4)))

     

    Hope that helps someone,

    Cheers,

    Dan

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard