How to Check Null Values in Power Automate Filter Query
Working with data in Power Automate often involves the need to filter records based on null values. In this blog post, we’ll explore the correct approach to check for null values in the Filter Query and address common misconceptions. By understanding the nuances, you’ll gain the ability to handle null values effectively and achieve accurate results.
What Doesn’t Work?
There are a few common mistakes to avoid when checking for null values in the Filter Query:
Field eq ‘ ‘ (Space): Using a space (‘ ‘) within the quotes won’t yield the desired results. It treats the space as a non-null character and won’t match records that have null values in the field.
Field eq {null} (Null Expression): Writing ‘null’ within the quotes won’t work either. The expression will be treated as a string comparison and not evaluate to null values. It won’t filter the items as expected.
Field eq ‘null’ (String Comparison): Using the string ‘null’ within the quotes won’t correctly identify null values either. It performs a string comparison and won’t match the desired records that have actual null values.
What Works?
To check for null values in the “Get Items” action, the following expression is the correct approach:
Field eq null
This expression filters the items based on the specified field being null. It is a reliable and recommended way to retrieve records without a value in the field.
Conclusion: When working with the Filter Query in Power Automate, it’s crucial to understand how to properly check for null values. Using the expression “Field eq null” is the recommended approach for filtering items based on null values. Avoid using spaces, the term ‘null’ as a string, or the ‘null’ expression, as they won’t yield accurate results.