The Power Automate Conditions Guide | Many Examples

Power Automate Conditions Explained 2

What are conditions in Power Automate? Power Automate Conditions are the if clauses in Microsoft flows. Whenever you need to decide how to proceed within your flow based on one or multiple conditions, the Power Automate Condition action is your friend.

There is also a Power Automate if function which you can use to return a value based on one or multiple conditions. You might ask when to use the Power Automate if function and when to use Power Automate Conditions.

Conditions let you create two branches within your flow. One branch if the conditions is met and one if it is not. So whenever your flow should proceed in different ways based on your conditions, use conditions.

If function is perfect to assign values. For example, when you want to have a default value for an empty string. Check for emptiness, if empty return your default value.

Let’s learn how to set conditions in Power Automate.

How to use Power Automate Conditions

This step-by-step guide shows you how to use Power Automate conditions to evaluate the result of an approval. I kept it as simple as possible.

  1. Create a new Instant Cloud Flow with ‘Manually trigger a flow’

    Power Automate Conditions New Flow

    Create a new Power Automate Flow

  2. At a ‘Start and wait for an approval’ action to the flow

    Power Automate Conditions Add Approval

    Add Start and wait for an approval action

  3. Configure Start and wait for an approval action: Approval type “Approve/Reject – First to respond”,Title “Can I borrow your car?” and Assigned To “User email”

    Power Automate Conditions Approval 1

    Setup Start and wait for an approval action

  4. Add a Condition Control

    Power Automate Conditions add condition action

    Add a condition to flow

  5. Configure condition: Compare Outcome via is equal to ‘Approve’

    Power Automate Conditions setup condition

    Configuration of Power Automate Condition

  6. Do a test run and accept the approval. Expression result will be true.

    Power Automate Conditions Test Run Appprove

    Result Test Run

Comparisons

Tu understand how to configure a condition, it is good to understand which options you have. The Condition action provides the following comparison options to define your conditions.

Power Automate Condition comparisions

Let’s take a look at each of them in action.

contains

A Power Automate contains condition lets you verify whether a string contains another string or an element is within an array.

String comparison

Note: Power Automate contains conditions are case-sensitive. [ABC contains A => true, but ABC contains a => false]

Power Automate Condition contains
Power Automate Condition – contains (string; result true)

Array comparison

Power Automate Condition Contains array

does not contain

A Power Automate does not contain condition lets you verify whether a string does not contain another string or an element is not within an array.

String comparison

Note: Power Automate does not contain conditions are case-sensitive. [ABC does not contain a => true, but ABC does not contain A => false]

Power Automate Condition Does not contain
Power Automate Condition – does not contain (string; result true)

Array comparison

Power Automate Condition does not Contain array
Power Automate Condition – does not contain (array; result true)

is equal to

A Power Automate is equal to condition lets you verify whether a is equal to b. The most common usage is on strings and numbers.

String comparison

Note: Power Automate is equal to conditions are case-sensitive. [ABC equal to ABC => true, but ABC equal to Abc => false]

Power Automate Condition is Equal To
Power Automate Condition – is equal to (string; result true)

Number comparision

Power Automate Condition is Equal To integer
Power Automate Condition – is equal to (integer; result true)

is not equal to

A Power Automate is not equal to condition lets you verify whether a is not equal to be. The most common usage is on strings and numbers.

String comparison

Note: Power Automate is not equal to conditions are case-sensitive. [ABC is not equal to Abc=> true, but ABC is not equal to ABC=> false]

Power Automate condition is not equal to
Power Automate Condition – is not equal to (string; result true)

Number comparision

Power Automate condition is not equal to integer
Power Automate Condition – is not equal to (integer; result true)

is greater than

String comparison

Power Automate Condition is greater than 2
Power Automate Condition – is greater than (string; result true)

Number comparison

Power Automate Condition is greater thani nteger
Power Automate Condition – is greater than (integer; result true)

is greater than or equal to

String comparison

Power Automate Condition is greater than or equal to 2
Power Automate Condition – is greater than or equal to (string; result true)

Number comparison

Power Automate Condition is greater than or equal to integer
Power Automate Condition – is greater than or equal to (integer; result true)

is less than

String comparison

Power Automate Condition less than
Power Automate Condition – is greater than (string; result true)

Number comparison

Power Automate Condition is less than integer
Power Automate Condition – is less than (integer; result true)

is less than or equal to

String comparison

Power Automate Condition is less than or Equal To 2
Power Automate Condition – is less than or equal to (string; result true)

Number comparison

Power Automate Condition is less than or equal to integer
Power Automate Condition – is less than or equal to (integer; result true)

starts with

A Power Automate starts with condition lets you verify whether a string starts with a given string or not.

String comparison

Note: Power Automate starts with conditions are NOT case-sensitive. [ABC does starts with a => true]

Power Automate condition starts with
Power Automate – starts with (string; result true)

does not start with

A Power Automate does not start with condition lets you verify if a string not starts with a given string.

String comparison

Note: Power Automate does not start with conditions are NOT case-sensitive. [ABC does not start with a => false]

Power Automate Condition does not start with 2
Power Automate Condition – does not start with (string; result true)

ends with

A Power Automate ends with condition lets you verify whether a string ends with a given string or not.

String comparison

Note: Power Automate ends with conditions are NOT case-sensitive. [ABC ends with c => true]

Power Automate Condition ends with
Power Automate – ends with (string; result true)

does not end with

A Power Automate does not end with condition lets you verify if a string does not end with a given string.

String comparison

Note: Power Automate does not end with conditions are NOT case-sensitive. [ABC does not end with c => false]

Power Automate Condition does not end with
Power Automate – does not end with (string; result true)

How To Add Multiple Conditions in Power Automate

Quite often one condition is not enough. As soon as you need to change date or number ranges, you need at least two conditions.

Fortunately, Power Automate Condition action lets you have multiple conditions. You simplify, click the ‘+ Add’ button at the bottom of the condition action. You can even decide, if these conditions should be connected by an And or an Or.

In case you don’t know:

  • And means every condtion must evaluate to true, otherwise the condition is not met.
  • Or means just one conditions needs to be true.

Okay, that’s good, but what if we want mix And and Or in our conditions and want to group conditions like we can do with brackets in programming? This is where Power Automate Condition Groups useful.

Power Automate Condition Grouping

First of all, I like to show you, how to add a Condition group. When you click on add, you select ‘Add group’.

Power Automate Condtion Group
How to add a Power Automate Condition group

Now let’s play with Power Automate Condition groups.

To express the following code with a Power Automate Condition.

If(
    (age < 40 And income < 3000) Or
    (age > 40 And age < 50 And income < 4000)
) doSomething()

Utilize Condition groups like shown below:

Power Automate Condition Group
Power Automate Condition group

Power Automate Condition Limits

There is a limitation of 10 conditions per Condition action. After the 10th condition, the add button gets inactive, as you can see in the picture.

Power Automate Condition Limits
Power Automate Condition Limits (max. 10 conditions)

You did not hear it from me, and I do not advise you to do so! But what happens, if you do this? :-).

Power Automate Condition Limits more than 10
Power Automate Condition Limit Hack 🙂

Power Automate Condition Examples

Let’s learn how to use condition in Power Automate by taking a look at some examples.

if blank

Power Automate Condtion if blank

length of array

Power Automate Condition length of array

date equals today

Power Automate Condition date equals today

Leave a Comment

Your email address will not be published.