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 / Get Items with date co...
Power Automate
Answered

Get Items with date column older than one year.

(0) ShareShare
ReportReport
Posted on by 156

Hello,

 

I'm trying to craft a flow that gets items in a sharepoint list where a DateColumn returns as older than one year and the column IsActive returns as true. So far I've tried variations on the following OData filter query in Get Items:

month(DateColumn) eq @{formatDateTime(utcNow(),'mm')} and year(DateColumn) lt @{formatDateTime(utcNow(),'yyyy')} and IsActive eq true

I know that my date functions crafted in Flow are returning correctly, but the OData query syntax and functions must be off. I tried following the syntax listed here in section 4.5 under the date functions, but I'm a newbie and must be making a mistake somewhere. Any help would be most appreciated!

Categories:
I have the same question (0)
  • Verified answer
    tom_riha Profile Picture
    10,185 Most Valuable Professional on at

    Hello @AdamD ,

    you can't use any expression on the SP column when using in the OData query, you must use it as it is, all operations must be done on right side of the condition in the 'value' part.

    To get everything older than one year I'd compare the DateColumn with today's date - 1 year:

    DateColumn lt '@{addToTime(utcNow(),-1,'Year')}'

    and add the IsActive filter, I guess it's a Yes/No column so you should compare it with 1/0 value:

    Date lt '@{addToTime(utcNow(),-1,'Year')}' and IsActive eq 1

     

  • AdamD Profile Picture
    156 on at

    Yes! Thank you so much @tom_riha !

  • Power_Person Profile Picture
    71 on at

    Thank you for your great solution!
    How could I change the condition to send an email when the date is exactly 60 days ago?

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
David_MA Profile Picture

David_MA 112 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 52

#3
Ellis Karim Profile Picture

Ellis Karim 51 Super User 2026 Season 1

Last 30 days Overall leaderboard