Doesn’t know how to apply filter between dates in Power Automate? Then this Power Automate tutorial will help you to apply filters between dates using flow with different examples.
Moreover, we will also cover below points:
- Odata filter query last 3 days
- Odata filter query greater than or equal
In this tutorial, we will use the Products Orders SharePoint List consisting of Product ID, Product Name, Product Color, Quantity, Total Price, OrderedDate, Mode of Payment, Product Delivered status, Current date field, and Estimated Date field.
Apply Filter Between Dates using Power Automate
Let us see how to filter the SharePoint list of items between dates using Power Automate flow.
Now we will create a flow to filter the values if the Ordered date is less than or equal to today’s date.
Initially, Log in to Power Automate and create an instant cloud flow to trigger manually.
- We will use the get items action to apply the filter while receiving list items from SharePoint.
- Select the +new step, add the Get items action, and configure the SharePoint site address and list name.
- Expand Show advanced options to see the Filter Query Option. Apply the below query to get the items where the Ordered date is less than or equal to today’s date. (whereas today’s date is 03/07/2023).
- Make sure the in-filter query you have passed the SharePoint list column’s internal name.
"OrderedDate le '@{utcNow('yyyy-MM-dd')}'"
- We will create an HTML table with custom headers and dynamic values, so click on the Next step and select Create Html table action.
- In the From Field, select the value of get items from the dynamic content and map the field value to view filtered values from the SharePoint list.
Now click on Save and run the flow manually by selecting the run flow option. Once the flow runs successfully like below:
We can see the filtered list item values in the output of Create HTML table action based on the condition applied.
This is how to filter the SharePoint list of items between dates using Power Automate flow.
Odata filter query last 3 days in Power Automate
Here we will see how to apply a filter query to filter values for the last 3 days using Power Automate.
Here we will filter the values if the Ordered date is equal to less than 3 days from today and the current date is equal to today’s date. (whereas today’s date is 03/07/2023).
- Create an instant cloud flow to trigger manually. Select the +new step, add the Get items action, and configure the SharePoint site address and list name.
- Expand Show advanced options to see the Filter Query Option. Apply the below query under the expression tab to get the items where the Ordered date is equal to less than 3 days from today and the current date is equal to today’s date.
"OrderedDate eq '@{addDays(utcNow(),-3,'MM-dd-yyyy')}' and CurrentDate eq '@{utcNow('dd-MM-yyyy')}'"
- Select Create Html table action with custom headers and dynamic values.
- In the From Field, select the value of get items from the dynamic content and map the field value to view filtered values from the SharePoint list.
Save and Test the flow manually by selecting the run flow option. Once the flow runs successfully like below:
We can see the filtered list item values in the outputs of Create HTML table action based on the condition applied.
This is how to apply a filter query to filter values for the last 3 days using Power Automate.
Odata filter query greater than or equal in Power Automate
Let us see how to apply a filter query to filter values that are greater than or equal using Power Automate.
Now we will filter the values if the EstimatedDeliver is greater than today. (whereas today’s date is 03/07/2023).
- Create an instant cloud flow to trigger manually. Select the +new step, add the Get items action, and configure the SharePoint site address and list name.
- Expand Show advanced options to see the Filter Query Option. Apply the below query under the expression tab to get the items where the EstimatedDeliver is greater than today.
"EstimatedDelivery ge '@{formatDateTime(utcNow(),'MM-dd-yyyy')}'"
- Select Create Html table action with custom headers and dynamic values.
- In the From Field, select the value of get items from the dynamic content and map the field value to view filtered values from the SharePoint list.
Save and Test the flow manually by selecting the run flow option. Once the flow runs successfully like below:
We can see an expected result in the output of Create HTML table action based on the condition applied.
This is how to apply a filter query to filter values that are greater than or equal using Power Automate.
In this Microsoft Power Automate tutorial, we have learned how to apply filters between dates using Power Automate flow with different examples. We have also covered the below examples:
- Odata filter query last 3 days
- Odata filter query greater than or equal
You may also like:
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com