web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow with Dates Filter...
Power Automate
Unanswered

Flow with Dates Filter Query

(0) ShareShare
ReportReport
Posted on by 1,265

Hello,

I have a Flow where I am using a "Get items' to collect records based on dates.  To verify steps, I have created "Compose" steps for identifying a StartDate and EndDate.  I am then using these in the Filter Query of the Get items.

 

What I don't understand is why the Filter Query does NOT pull records for the "equal" portion of "ge" and "le"?  It appears the function is more of a between dates.  When I run the Flow, I receive records with Created dates of 8/1/2022 through 8/4/2022.

 

RJF61_0-1660148342926.png

Can someone assist me?

 

Categories:
I have the same question (0)
  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    Filter query requires the dates to be in the format yyyy-MM-dd . Try the following example:

     

    addDays(utcNow(), -10,'yyyy-MM-dd')

    addDays(utcNow(), -5, 'yyyy-MM-dd')

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • RJF61 Profile Picture
    1,265 on at

    @ekarim2020 Thanks for the response.

    As you suggested I updated the date formats but am still not receiving data that was entered on 2022-07-31 or 2022-08-05.

  • RJF61 Profile Picture
    1,265 on at

    @ekarim2020 Is it possible there is an issue using the "Created" field?

  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    Hi @RJF61 ,

     

    Please post a screenshot of the runtime output of Get Items action. This will show us the actual values for the filter query, for example:

    Snag_614389.png

    You can use a Select action to select just the the IDs and Created dates for easy reference:

    ekarim2020_0-1660160997972.png

     

    Looking at the runtime outputs of the Select action shows that the Get Items filter query is working as expected:

    Snag_67f69f.png

    The results seem to be in the range (Created date greater or equal to  '2022-07-31')  and (Created date less than or equal to '2022-08-05'):

    Snag_689ee5.png


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • RJF61 Profile Picture
    1,265 on at

    Following are screen shots.

    RJF61_1-1660163089903.png

    RJF61_3-1660163574910.png

     

    I did review the Select 2 information and the Query Filter did not return 2022-08-05 dates.

    RJF61_2-1660163188282.png

     

  • RJF61 Profile Picture
    1,265 on at

    As a side note, I did create another date field "CreatedDD" and copied the Created dates to the new field.  Running the Flow from the CreatedDD field, I receive the correct data.

  • Verified answer
    Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    Just an important note about the filter query.

     

    To include all records created on the 2022-08-05 (EndDate) and I mean anything created between 2022-08-05 Hour:00 Min:00 seconds:00 and 2022-08-05 23:59:59, you will need to adjust the EndDate by one day, and change the operator to less than (lt):

     

    StartDate ge 2022-07-31 and EndDate le 2022-08-05

    StartDate ge 2022-07-31 and EndDate lt 2022-08-06 

     

    Updated EndDate expression:

    Snag_902bb7.png

     

    Updated Filter Query:

    Snag_923c28.png

    Get Items runtime:

     

    Snag_934e44.png

     

    Select action updated to show time and includes all records created on 2022-08-05:

    Snag_94bc89.png

    Hope this helps.

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • RJF61 Profile Picture
    1,265 on at

    @ekarim2020 

    Thanks for the help.  I’ll make the updates this evening.  Does this mean I am misunderstanding the equals portion of “ge” and “le”?  Initially I wanted to run a report every Friday for all records from Sunday through the Friday report day (run report on Friday 8/5 for 7/31 through 8/5).

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard