Skip to main content

Notifications

Community site session details

Community site session details

Session Id : isWcs3dqWySWUEYYKkq8uM
Power Automate - Building Flows
Answered

Can Switch case contain expression?

Like (0) ShareShare
ReportReport
Posted on 20 May 2020 12:13:46 by 76

Hello all,

 

Inside the Case of a Switch, is it possible to use expressions? e.g. 

equals(parameters('parameter1'), 'someValue')

 

The Switch itself would be 'True' or 'False'.

 

This is a common construct in programming languages. In Power Automate, it seems that the expression can only go inside the Switch part, and literal values in the Case parts. Is that correct?

 

Thank you! 

  • Julien Groud Profile Picture
    on 21 May 2020 at 02:37:41
    Re: Can Switch case contain expression?

    Thanks for sharing this.

  • Verified answer
    Pstork1 Profile Picture
    66,162 Most Valuable Professional on 20 May 2020 at 12:45:10
    Re: Can Switch case contain expression?

    The Switch statement in Power Automate works the same way that a SWITCH() works in C#.  It matches the variable provided to specific values.  C# also won't let you use expressions in the target values. So I doubt you will see that functionality anytime soon in Power Automate either.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 93

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 70 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 48 Super User 2025 Season 1

Overall leaderboard
Loading started