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 / Delete Records older t...
Power Automate
Suggested Answer

Delete Records older than 5 years

(0) ShareShare
ReportReport
Posted on by 443
I have a list of records that I'm trying to set up a reoccurring flow for.  I used the expression below (in the Get Items action), but I am getting the below error:
 
Action 'Get_old_records' failed: The expression "Modified le 10-24-2019" is not valid. Creating query failed.
 
My expression is almost identical one to verified to work:
 
Modified le 'addToTime(utcNow(),-5,'Year','MM-dd-yyy')'
 
The date column I'm checking against is using the standard format.
 
What am I missing?
Categories:
I have the same question (0)
  • Suggested answer
    Ellis Karim Profile Picture
    12,187 Super User 2026 Season 1 on at
    Change the date format to ISO 8601 format:
    addToTime(utcNow(),-5,'Year','yyyy-MM-dd')
     
    Ellis
  • lumberjacklurch Profile Picture
    443 on at
    I made the correction, but I still get the error.
     
     
    I don't understand, from the error and the parmeters, it should work.
     
     
    I feel like I'm missing something obvious.
  • Suggested answer
    Ellis Karim Profile Picture
    12,187 Super User 2026 Season 1 on at
     
    Enclose the expression in single quotes as shown below:
     
     
     
    Ellis
     
  • lumberjacklurch Profile Picture
    443 on at
    I knew it was something obvious.  Thanks!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 246 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 176

#3
Haque Profile Picture

Haque 157

Last 30 days Overall leaderboard