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

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

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