Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Solution
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

Replace multiple conditions with single Power Automate expression

Posted on February 12, 2023February 27, 2023 by Tom

“I feel that I’ve got too many conditions to handle basic stuff, can I somehow reduce/replace them to simplify my Power Automate flow?”


Conditions, one of the key building blocks in Power Automate. A simple decision: if “something” is true, do this, otherwise do that. But often it’s not that simple and if a condition is false it leads to another condition, another true or false. And the more potential options there’re, the more conditions you’ll need.

Is that really necessary? Isn’t there an easier way than a tree of conditions?

Replace the conditions with if(…) expressions

The Power Automate if(…) expression is the equivalent of the ‘Condition’ action. Instead of adding the action and then deciding e.g. on a value for some field, you can use the if(…) expression to get the correct value right away.

The basic if(…) expression was already explained in the date-formatting article and looks as below.

if(<condition>, <ifConditionIsTrue>, <ifConditionIsFalse>)

What you maybe didn’t know is that you combine them inside each other. Evaluate the first condition, and if it’s false try another evaluation.

if(<condition>, 
  <ifConditionIsTrue>, 
  if(<condition2>, 
    <ifCondition2IsTrue>, 
    <ifCondition2IsFalse>)
)

And it can go on an on, as many ifs as you need. But how do you build such expression?

Start from the last ‘Condition’

Let’s take an example, a flow where you translate a number into more generic value. If the number is less than 3 the value is LOW, for 3 or 4 it’s MID, and if it’s 5 or more it’s HIGH. When using the ‘Condition’ actions it’ll look as below.

To turn it into a single expression with if(…) start from the bottom. The last condition evaluates whether the value is less than 5.

if(less(outputs('Compose_-_Value'), 5),<ifTrue>,<ifFalse>)

You can use the trick with the ‘Filter array’ action if you’re not sure how to write such condition.

If it’s true, use the value MID, otherwise use the value HIGH.

if(less(outputs('Compose_-_Value'), 5), 'MID', 'HIGH')

That was the last condition, now let’s go one step higher, to the previous condition. The flow will reach the 2nd condition only if the first condition is false.

if(<condition>, <ifTrue>, if(less(outputs('Compose_-_Value'), 5), 'MID', 'HIGH'))

The first condition should evaluate whether the value is less than 3.

if(less(outputs('Compose_-_Value'), 3), 
  <ifTrue>, 
  if(less(outputs('Compose_-_Value'), 5), 
    'MID', 
    'HIGH'
  )
)

And if it’s true, it should use the value LOW.

if(less(outputs('Compose_-_Value'), 3), 
  'LOW', 
  if(less(outputs('Compose_-_Value'), 5), 
    'MID', 
    'HIGH'
  )
)

Since there’re no other conditions in the flow, that’s it. A single expression that’ll get the value without branching the flow.

Summary

Whenever you start stacking conditions in your Power Automate flow, you should reconsider whether they are needed, or if you can replace them and simplify the flow. Start from the last condition, convert it into if(…) expression, and keep adding the other conditions around it. At the end it can be a single expression that can replace a whole bunch of the ‘Condition’ actions.

It’s another concept complementing the configuration lists that’ll help you build more efficient and easier to manage flows.


πŸš€ Master Power Automate

Join 2,100+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

πŸš€ Master Power Automate

Join 2,100+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Still exchanging emails to get things approved?

Get the Approval Process solution to skip the hard part and deploy an automated, fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Are your approvals stuck due to unavailable approvers?

Keep your approvals running with the Approval task delegation app! Reassign any existing approval task to another user with a single click - no more waiting for absent approvers!

Power Automate approval task delegation ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes