cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
i_power
Advocate I
Advocate I

Can Switch case contain expression?

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! 

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
Pstork1
Dual Super User III
Dual Super User III

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Thanks for sharing this.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (81,587)