cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
torkelsont
Level: Power Up

Filter SharePoint list by date not working

I have a flow that is using the get SharePoint items action from this I am trying to filter the results based on a Date.

Using the default Created field from SharePoint and using multiple different values for the datetime filter.

I have tired to pass just a formatted date, using the date functions in flow, and the get past time action. All of these return the same thing which is just the top 100 items in the SharePoint list ignoring the filtering of the date.

example Filter Query

Created le datetime'2018-02-26T00:00:00'

This would return things that where created after this date.

 

1 REPLY 1
Community Support Team
Community Support Team

Re: Filter SharePoint list by date not working

Hi @torkelsont,

 

Could you please share a screenshot of your flow's configuration?

Do you use OData Query within Filter Query field of "Get items" action?

Further, could you please show a bit more about the OData query within the Filter Query field of your "Get items" action?

 

I think there is something wrong with the formula that you provided within Filter Query field of the "Get items" action. I have made a test on my side and please take a try with the following workaround:1.JPG

Within Filter Query field of "Get items" action, type the following formula:

Created le 'formatDateTime(...)'

The formatDateTime(...) expression within above formula read as below:

formatDateTime('2018-03-27','yyyy-MM-ddThh:mm:ssZ')

Note: The formatDateTime(...) expression within above formula is wrapped with single quotes. In addition, the above formula would filter items whose created date is before the specific datetime.

 

The flow works successfully as below:2.JPG

 

 

More details about using Data Operations within SharePoint connector, please check the following article:

https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/use-odata-query-operations-in-sharepoint-...

 

More details about Date Functions within Microsoft Flow, please check the following article:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language#functions

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Users online (8,993)