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 'Archived' Item...
Power Automate
Answered

Delete 'Archived' Item after Five Years

(0) ShareShare
ReportReport
Posted on by 5,331 Moderator

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,280 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,331 Moderator 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

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 58

#2
David_MA Profile Picture

David_MA 53 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 36 Most Valuable Professional

Last 30 days Overall leaderboard