cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bahalzamon
Advocate II
Advocate II

Flow Query Filter Date Range

Basically I am doing a Get Items and attempting to filter the data based on a date range. I have come across MANY different suggestions and have attempted them all with no luck.

 

Here is what I am working with:

From Date: Date Only

To Date: Date Only

 

The Get Items works properly with no query and returns everything, but I want to filter based on passed in dates.

 

Here is how it currently looks:

10-29-2020 10-25-03 AM.jpg

 

I have tried many different options for converting the date values such as datetime'fromDate' with no luck.

All I receive is the filter is not valid.

 

Thanks for any help. 😃

22 REPLIES 22

@scasselhas 

 

remove the 00:00, if you want that in there incorporate it into the formatDateTime, if you want to incorporate it you have a couple options.

 

formatDateTime(addDays(utcNow(),-1),'MM-dd-yyyy hh:mm')

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

 

but if you want the start of the day, I would use startOfDay as you can format it in there as well:

startOfDay(addDays(utcNow(),-1),'MM-dd-yyyy hh:mm')

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

Actually the problem it that it only works with -1, any other number brings an empty list

I would check the error you are getting, for the date maybe put it within a compose operation to see what the end result is and the query being sent to the get items.

If you are expecting 10,000 entities returned then you would definitely turn on the pagination, I think its limit is 5,000 so you can most likely remove the top 10,000.

 

I think to go further into it I would need to see more of your process

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,143)