- Published on
Check JSON object null/empty in Power Automate
- Authors
- Name
- Piyush Paliwal
- @_ppaliwal
Table of Contents
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.
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 mehtods 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>)
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.