In Power Automate, if you need to check if a variable or field or cell is empty, use the empty() expression. If the thing your checking is empty, the expression will return true. If not empty, the expression will return false.

The expression can be used in a conditional action, or as part of another expression.


Example 1: empty() used in a conditional action.

1.) Initialize a variable called MyVarString and don’t give it an initial value.
2.) Add a step and the condition action.
3.) Click in the first box, then choose Expression, it’s the second tab, and then type in the following.

empty(variables('MyVarString'))

4.) Choose “is equal to” in the second box and type in true in the third box.

Test the Flow, the result of the condition should be true.


Example 2: empty() used in another expression, the if() expression.

The if() expression is like the if function in excel. You check if something is true or false and then return something based on that check. It’s also basically the same as the condition used above, but in function form.

if(check something, return this if true, return this if false)

1.) Initialize a variable called MyVarString1 and don’t give it an initial value.
2.) Initialize a second variable called MyVarString2.
3.) Click in the value box of MyVarString2, then choose Expression, it’s the second tab, and then type in the following.

if(empty(variables('MyVarString1')),'Var is Empty','Var is Full')

Test the Flow, the output of MyVarString2 should be Var is Empty.

Was this helpful?

0 / 0