Filter items without a date

Filter SharePoint list items without a date in Power Automate

So you have a list and that list has a date field. Now you only want to get the items that have a date set and filter out the items without a date.

SharePoint date field

This problem could for example appear in tasks lists where some tasks have a due date set.

In my example, the SharePoint date field in a list can be empty. My first date is on 23 March. The second date is on the 25th and my 3rd date is just empty.

Filter SharePoint list items without a date in Power Automate Microsoft Office 365 image 32

Using a filter Query using a null expression

Now we could use the null value expression like this:

Filter SharePoint list items without a date in Power Automate Microsoft Office 365 image 33

But when you run this flow we will see the following error:

The expression “Date ne” is not valid. Creating query failed.

Filter SharePoint list items without a date in Power Automate Microsoft Office 365 image 34

Using a null value again to filter items without a date

There is however a way that we can make filtering without a date work.

Using a null value again to filter items without a date

Date ne null as a Filter query expression does work?

Why?

Well the null expression will resolve as nothing and therefore the Date ne is being past to the underlying SharePoint API.

When we use Date ne null we will send exactly that to the filter expression used by the SharePoint REST API and the null value is now used to filter against.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 4,909 other subscribers

Recent Posts

Archive

Thank you for visiting SharePains

%d bloggers like this: