Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Flow Query Filter Date Range

(2) ShareShare
ReportReport
Posted on by

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. 😃

  • rekha97jr Profile Picture
    34 on at
    Re: Flow Query Filter Date Range

    @Bahalzamon I tried to solve the above using 'id greater than 0' as the condition. 

     

    The next error is that I am not able to select any azure data in the connector 'send a http request to azure devops'. its rather taking dynamic content from microsoft forms and hence i'm getting the error in the POST query as attached. [ in this case the user enters only FROM and TO dates . I want to retrieve all 'workitems' which fall within these 2 dates]

  • rekha97jr Profile Picture
    34 on at
    Re: Flow Query Filter Date Range

    @Bahalzamon , Sorry what I meant was - my forms is embedded in sharepoint as a web element, hence i was mentioning as sharepoint. 

    In forms, am I not specifically targetting 'from date' and 'to date' here? I am checking if either of these fields are null entries, then just check the 'ID' that user has entered. ( The user can enter 'ID' or 'both the dats').

     

    I want to know how to check if 'ID' or 'from and to dates' are null or not in microsoft forms.

     

  • Bahalzamon Profile Picture
    on at
    Re: Flow Query Filter Date Range

    @rekha97jr  your just doing is not equal to null, which means if you have any info in there it will evaluate to true...

    your saying sharepoint, but you are evaluating information from forms not sharepoint.

  • rekha97jr Profile Picture
    34 on at
    Re: Flow Query Filter Date Range

    Hi @Bahalzamon   I have added a condition for 2 of my fields in sharepoint, which says "Evaluate to TRUE if From date and To date are having values. evaluate to false otherwise". But i dont knw why it always evaluates to TRUE when tested.

    Irrespective of whether i pass the date values or not in sharepoint, its always displaying TRUE in power automate.

    can you please check.

  • Bahalzamon Profile Picture
    on at
    Re: Flow Query Filter Date Range

    @rekha97jr you are running parallel processes, they do not have access to each others information.

    Also, I am not familiar with all the Azure stuff you are attempting to run.

    You need to do a "Get Items" using a SharePoint connector NOT Azure.

    Bahalzamon_0-1681304604944.png

    Then fill out the Filter Query.

     

    Going off the info I have your flow should be:

    1. When form is filled out (forms/trigger)
    2. get form details (forms)
    3. get items (sharepoint)
      1. Created ge formatDateTime(fromDate,'yyyy-MM-dd') and Created le formatDateTime(toDate,'yyyy-MM-dd')
  • rekha97jr Profile Picture
    34 on at
    Re: Flow Query Filter Date Range

    Hi @Bahalzamon Yes got it, so i was trying to figure out how to get the 'date inputs' which are in sharepoint, onto power automate. As you see in the image 'capture', on the left , i am able to 'get workitem details' as 'ID' is present within that connector. But on the right side, I cannot get my workitem details as there's no option to enter dates and retrieve ids based on Dates.

    even 'filter array' connector doesn't have 'date expression' that can be detected/pulled from sharepoint(i.e web element microsoft forms).
    I hope I explained the issue better this time. Please look into this.

  • Bahalzamon Profile Picture
    on at
    Re: Flow Query Filter Date Range

    @rekha97jr What you have there is how Forms works, you have a Trigger of "When a new response is submitted" that is just the trigger and returns ONLY the ID of the record that was filled out and it doesn't function like the SharePoint triggers where it returns all the information from the item. For the information you use the "Get response details" Action that will pull in all the information from the form.

    Using that information you can then apply that to your data source for filtering.

  • rekha97jr Profile Picture
    34 on at
    Re: Flow Query Filter Date Range

    @Bahalzamon I am stuck right at the beginning. I see you were able to dynamically insert 2 dates from a sharepoint list. I have something similar - a FROM DATE and a TO DATE present in microsoft forms, and connected as a Web Element on my sharepoint list. When i try 'get items' on these dates it doesnt even detect them. Please refer to 'capture' image for what i have on sharepoint and 'capture1' for power automate.

     

    Please help. I have been struggling to figure it out.

     

  • Bahalzamon Profile Picture
    on at
    Re: Flow Query Filter Date Range

    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

  • scasselhas Profile Picture
    8 on at
    Re: Flow Query Filter Date Range

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1