How to use expressions and conditions in Power Automate/Flow?
While creating a cloud flow you may encounter some need of conditions/expressions for logic building. You can use condition card in basic mode to quickly compare a single value with another value.
Note: You can add up to 10 condition rows under one logical value. To add more rows under one logical value, first add group then ungroup that group you will see more rows under one logical value.
However when you need to compare multiple values with multiple logical values you can add group in your condition block.
Note: Whatever conditions you are using in condition action you can always write that expression in a compose action.
Following expressions are available in flow studio-
Expression | Explanation | Supported type | Example |
---|---|---|---|
and | Returns true if both arguments are true otherwise returns false | Boolean | and(greater(12,1),equals(5,5)) |
or | Returns true if either arguments is true otherwise returns false | Boolean | or(greater(12,1),equals(5,5)) |
not | Returns the opposite of a boolean value. | Boolean | not(contains('Status','Approved') |
if | Returns a specific value if the expression results in true or false. | - | if(equals(1,1),'Yes','No') |
empty | Returns true if the object, array, or string is empty. | Object, Array and String | if(empty(''),'Yes','No') |
equals | Returns true if two values are equal | - | equals(1,1) |
less | Takes two arguments and returns true if the first argument is less than the second argument. | Integer, Float,String | less(12,120) |
lessOrEquals | Takes two arguments and returns true if the first argument is less than or equal to the second argument. | Integer, Float,String | lessOrEquals(12,12) |
greater | Takes two arguments and returns true if the first argument is greater than the second argument. | Integer, Float,String | greater(14,1) |
greaterOrEquals | Takes two arguments and returns true if the first argument is greater than or equal to the second argument. | Integer, Float,String | greaterOrEquals(15,15) |
Example-
Thank You!!!
Gopenly