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 / Delete 'Archived' Item...
Power Automate
Unanswered

Delete 'Archived' Item after Five Years

(0) ShareShare
ReportReport
Posted on by 5,325 Super User 2025 Season 2

I have a recuring flow that is to delete items that are five years old with a status of 'Archived'.

Will the following Get Items Filter Query get the items I'm looking for?

     (Status eq 'string('Archive')' and 'Created eq 'string(formatDateTime(utcNow(),5))'

Categories:
I have the same question (0)
  • Verified answer
    ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

     

    I am assuming the the items are in a SharePoint list.

    It depends on the internal names of the columns, but the following should

    Status eq 'Archive' and Created le 'addToTime(utcNow(),-5,'Year','yyyy-MM-dd')'

     

    Obviously, the addToTime expression must be entered in the expression window.

  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at

    Will the below return ONLY both status identified that are seven or more days old?

    Get Items Filter Query -
    (Status eq 'string('Minutes Approved') or (Status eq 'Minutes Pending') and (Modified le addToTime(utcNow(),-7,'Days','yyyy-MM-dd')

  • lumberjacklurch Profile Picture
    443 on at
    Thank you both for this thread.  I used the expression below, 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 the one 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?

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard