Check JSON object null/empty in Power Automate

Often times when working with JSON objects we need to check if a value exists before further execution. See how you can easily use this method in Power Automate

Check JSON object null/empty in Power Automate

Microsoft Power Automate is a great platform when it comes to designing your workflows or automations with its easy to use drag-and-drop workflow builder and the hundreds of connectors that are available for Power Users.

More often than not, we come in a situation where there is some data available, in a given format, say JSON, and we would like to check in the data if certain value exists or not and based on that, a logic needs to be written. I was surprised to find out that the condition step does not have a property to check for empty or null values.

Power Automate condition control
Power Automate condition control

So, now the obvious question;

How do we check for null or empty?

Turns out, it is much more simple than I had thought, all you have know are a couple of methods which you can use in expressions.

empty() Method

Empty method, as the name suggests, will return a true or false if the given data is blank.

empty(<your-object>)
Condition evaluation Power Automate
Condition evaluation Power Automate

All you have to do is switch to Expression in the Dynamic content selection screen and start typing the formula and that’s it! Take a look at one example below.

Add Condition (animated)
Add Condition (animated)
Load Comments