Power Automate Get Items Filter Query Date [With Examples]

Recently, while using the Get Items flow action in Power Automate, I got a requirement to filter SharePoint list items based on Date. I will show you here how to use Power Automate Get Items filter query date with a few examples.

Get Items Filter Query Date Equals Today in Power Automate

In the first example, I will show you how to filter SharePoint list items based on a column value equal to Today using the Power Automate Get Items flow action.

Here, I have a SharePoint list that has a column as Resignation Date (Date Time column). I want to get items from the SharePoint list where the Resignation Date is Today.

Power Automate ODATA filter query date column todays date

Follow the below instructions:

  • Create an ‘Automated cloud flow’ with a trigger ‘When an item is created or modified’ and provide the below details:
    • Site address: Provide a specific site address from the drop-down.
    • List Name: Select a specific list from the drop-down.
power automate get items filter query date equals today
  • After that, add the ‘Get items‘ flow action and set the below details:
    • Site address: Select a specific site address from the drop-down.
    • List Name: Select a specific list from the drop-down.
    • Filter Query: Provide the condition as placed below code:
ResignationDate eq'@{formatDateTime(utcNow(), 'yyyy-MM-dd')}'
SharePoint get items for Todays date filter query by Power Automate
  • Then add Create HTML table and take a custom table to add values dynamically as shown below:
Power Automate filter items with query today
  • Once the flow has been created, Click on Save and Test.
  • Open the ‘Create HTML Table’ to view the output from the Power Automate filter query date as of today.
Power Automate Filter Query Date equals Today's Date

This is how to use a Power Automate filter query date comparison with today’s date to retrieve data from the SharePoint list.

Power Automate Get Items Filter Query Date Less Than Today

Now, we will see another example of “Power Automate get items filter query date less than today”.

Here, I wanted to get all items from the above SharePoint list where the Resignation Date is less than today.

In this Power Automate Get Items flow action, add the filter query like below:

ResignationDate lt '@{formatDateTime(utcNow(), 'yyyy-MM-dd')}'

Where [lt] refers to less than the operator in Power Automate filter query syntax.

Odata filter query date less than today's date Power Automate

To show the output in a readable format, I have added the ‘Create HTML table’ flow action, and you can see the output in the screenshot below.

Odata Filter Query Power Automate date less than today's date

This is how to filter SharePoint list items using Power Automate Get items filter query date less than today.

In the same way, if you want to filter SharePoint list items greater than today’s date, you can write the filter query like below:

ResignationDate gt '@{formatDateTime(utcNow(), 'yyyy-MM-dd')}'

Here, [gt] refers to greater than in Power Automate filter query syntax.

Filter query Odata date greater than today in Power Automate

You can see the output in the screenshot below.

power automate get items filter query date greater than today

Power Automate Get Items Filter Query Created Date

Here is another example, where you can filter SharePoint list items based on query date in the Power Automate Get Items flow action.

Below is a SharePoint having a few columns, and we will see how to filter items based on the created date less than today.

Power Automate Get Items Filter Query Created Date

In the Power Automate Get Items Filter Query write the below formula.

Created lt '@{startOfDay(utcNow(),'yyyy-MM-ddTHH:mm:ssZ')}'

Here, (lt) means – less than in the Power Automate filter query syntax.

power automate get items filter query date less than today

To show the output, I have added a Create HTML Table flow action.

power automate get items filter query date less than today

Once you run the flow you can see the list of items whose Created date < Today Date.

power automate get items filter query modified date

This is how to use Power Automate OData filter query created date less than today’s Date.

In the same, you can work with “Power Automate get items filter query modified date“.

Power Automate Get Items Filter Query Last 7 Days

Here, I will show you another example of the Get items filter query. We will see how to filter SharePoint list items created in the last seven days.

In this case, I have a SharePoint Event list with an ‘Event Start Date’ column, as shown in the screenshot below, and we will get all the events starting in the next seven days starting from today.

Power Automate OData filter query last 7 days

Here is the filter query for getting all the SharePoint items between the Event Start Date and seven days from today’s date.

EventStartDate gt '@{formatDateTime(addDays(utcNow(),-7),'yyyy-MM-dd')}'
Power Automate filter Date for last 7 days

Next, add Create HTML table as custom columns and provide column values dynamically as shown below:

How to filter last 7 days date in Power Automate

You can see the output after executing the flow.

Power Automate Get Items Filter Query last seven days

This is another example of “Power Automate Get Items Filter Query Last 7 Days”.

Power Automate Get Items Filter Query Date Range

Here is another example: how to use Power Automate Get Items to filter query by date range.

Here, I have a SharePoint Task List that has two columns: Start Date and End Date.

Power Automate Flow query filter date range

Here, we will see how to filter the list items: Start Date is less than or equal to the current date and the Task Due Date is greater than or equal to the current date.

ConditionActions
‘Start Date'<= Today’s date &
‘Task Due Date’ >= Today’s date
Fetch all the SharePoint list items that are in between that given condition.

In the Power Automate Get Items filter query, write like below:

(StartDate le '@{utcNow()}') and (TaskDueDate ge '@{utcNow()}')

Where [le] means less than or equal to and [ge] means greater than or equal to operators in the syntax of Power Automate filter query.

Power Automate using a filter query between two dates

In the same way, I have added a Create HTML table flow action to display the output in tabular format.

power automate get items filter query date range

See the output in the screenshot below.

power automate get items filter query date range

Power Automate Get Items Filter Query Date Is Null

Sometimes, you might be required to filter SharePoint list items when a date column value is null.

To show you the example, I will use the same Events list that has a column as ‘Event End Date’. We will get the events where the EventEndDate is Null.

In the Power Automate Get Items filter query, write the below formula, which will give us the items where the EventEndDate is null.

EventEndDate eq null

Where ‘null’ should not be in between single quotations in filter query syntax.

power automate get items filter query date is null

You can see the output in the screenshot below.

power automate get items filter query date is null

This is how to filter SharePoint list items using Power Automate get items filter query date is null.

Conclusion

I hope now you know how to filter SharePoint list items in Power Automate using the Get Items filter query based on date. We covered the examples below:

  • Power Automate get items filter query date range
  • Power Automate get items filter query date less than today
  • Power Automate get items filter query created date
  • Power Automate get items filter query date equals today
  • Power Automate get items filter query date greater than
  • Power Automate get items filter query date is null

You may also like: