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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Filter Query for Get I...
Power Automate
Answered

Filter Query for Get Items - anything due in 7-14 days time

(0) ShareShare
ReportReport
Posted on by 441

Hello,

 

I'd like to build a filter query to get anything that has a delivery deadline that equals 7-14 days away from the date the flow runs.

 

For example today is 01/08/23. When the flow runs, I'd like it to get items of anything that has a delivery deadline of the 8th-15th.

 

I currently use this to get anything with a delivery deadline of anything in the next 7 days which works great but not sure how to get the above to work.

 

JoshPullan11_0-1690884532641.png

 

 

Any helps appreciated as always.

 

Thanks,

Josh

Categories:
I have the same question (0)
  • Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @jap11 

     

    To get the records between range of dates, you need to write the below query:

    DeliverDeadline ge '@{formatDateTime(addDays(utcNow(),7),'yyyy-MM-ddTHH:mm:ssZ')}' and DeliverDeadline le '@{formatDateTime(addDays(utcNow(),15),'yyyy-MM-ddTHH:mm:ssZ')}'

    This query will return the records from 7-15 days (including 15) away from the date when flow runs. Here is the screenshot:

    ManishSolanki_0-1690885312094.png

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

     

  • Jap11 Profile Picture
    441 on at

    Hello @ManishSolanki 

     

    Thank you for your quick response.

     

    It seems i'm getting an error message when using this, could it be related to how the Delivery Deadline is formatted in my sharepoint list? can the filter query be amended accordingly to align with this format?

     

    JoshPullan11_0-1690885741030.png

     

     

    JoshPullan11_1-1690885756322.png

     

  • Verified answer
    Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @jap11 

     

    Pls try without giving blank space in column name. As you are only taking the date in that field so, we can skip the time part in the filter query:

    DeliveryDeadline ge '@{formatDateTime(addDays(utcNow(),7),'yyyy-MM-dd')}' and DeliveryDeadline le '@{formatDateTime(addDays(utcNow(),15),'yyyy-MM-dd')}'

    You may copy & paste the above statement directly into the "Filter query" textbox and try running the flow.

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • Jap11 Profile Picture
    441 on at

    Hi @ManishSolanki 

     

    Sorry this still didn't work. I tried without the blank space and it said the column did not exist, so i added back in the space and then got this error message. I also tried changing the order of the date to dd-MM-YYYY, as with how the column in sharepoint is formatted, but i got the same error

     

    JoshPullan11_0-1690886768240.png

     

    Thanks,

    Josh

  • Verified answer
    Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @jap11 

     

    In the filter query, we use the internal name of the field. Pls check the internal name of the 'Delivery Deadline' from the SharePoint site. 

    1. Go to List settings and scroll down to columns section:

    ManishSolanki_0-1690887152206.png

     

    2. Click on the "Delivery Deadline" column, here I am using different name (To be assigned to):

    ManishSolanki_1-1690887347909.png

     

    You can find the internal name at the end of the site address in Field query parameter (after Field=). In the above example, the internal name of 'To be assigned to' field is 'Tobeassignedto'. We are supposed to use the internal name in the filter query in "Get items" action. 

     

    Pls check the internal name of the field 'Delivery Deadline' and replace it with the field name in the Filter query.

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • Jap11 Profile Picture
    441 on at

    Hi @ManishSolanki  - that's done the trick.

     

    The column was named Delivery_x0020_Deadline - so once correctly to this in the expression, the flow ran successfully.

     

    Thank you very much.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 957

#2
Valantis Profile Picture

Valantis 847

#3
Haque Profile Picture

Haque 609

Last 30 days Overall leaderboard