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 / Odata filter query hel...
Power Automate
Answered

Odata filter query help— less than or equal to today plus 7 days

(0) ShareShare
ReportReport
Posted on by 56

Hi there. I am new to this and need to create an expression to only get items whose column "Next Maint. Due" is less than or equal to 7 days from now. What would I put in the filter query field of the get items step? I've tried a number of things that haven't worked.

 

And would having an initialize variable before or after this affect it? Essentially my end goal is to send a weekly email with a table of all items due this week (or over due). I can post links to videos I've been referencing to help with this, but right now I'm stuck on what to put in the filter query field.

Thank you!!

Categories:
I have the same question (0)
  • Verified answer
    Ellis Karim Profile Picture
    11,983 Super User 2026 Season 1 on at

    You can start b:

    • getting the current date/time (this will be in UTC time).
    • converting the current date/time (UTC) to for your time zone
    • Adding 7 days to the current date/time in your time zone
    • Specify the OData filter query using the internal SharePoint column name of the "Next Maint. Due" column and your calculated date

    For example:

    Snag_5b23823.png

    Then in your Get items filter query, add the SharePoint column name and date (enclose the date in single quotes). For example, Created date is less than or equal to the calculated time:

    Snag_5b45120.png

     

    You will need to use the internal column name for "Next Maint. Due". To find the internal column name of "Next Maint. Due" see How to find the internal name if a SharePoint Column.

     

    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.

     

  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    Hi @Hclor 

    What you need to do is to to use the Get Future Time action to get the time in 7 days as below

    Mira_Ghaly_0-1642109633887.png

    Then GetItems should look like below:

    Mira_Ghaly_1-1642110187394.png

    Expression 1:

    formatDateTime(utcNow(),'yyyy-MM-dd')

    Expression 2:

    formatDateTime(body('Get_future_time'),'yyyy-MM-dd')

     

    Note: Please note the single quotes around the formatdatetimeexpressions

  • kmw1130 Profile Picture
    995 on at

    I am trying to get SharePoint List items that are 7 days prior to start date AND 7 days after start date.  This is what I currently have for Get Items and not sure it is working correctly:

     

    Filter Query:

    kmw1130_0-1717170357124.png

    ge  

    formatDateTime(addDays(utcNow(),7),'yyyy-MM-dd')
     
    le  
    formatDateTime(addDays(utcNow(),7),'yyyy-MM-dd')

     

     

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard