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 / Auto-delete items base...
Power Automate
Answered

Auto-delete items based on Modified date (standard format)

(0) ShareShare
ReportReport
Posted on by 300
Hi! I am trying to perform auto-delete items based on the Modified column (standard format) in SharePoint.
 
Items that are older than 4 weeks (28 days) should be deleted.
 
Am I missing something with my filter query? It could be some simple tweak I overlooked. Appreciate your help!
 
Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    69,024 Most Valuable Professional on at
    Since the internal Dates will be stored in UTC format it would be better to use ISO 8601 utc format for the date when you are querying.  I would just do AddDays(UtcNow(), -28). You may also want to test the Status eq 'Completed' piece separately. Status is probably a choice column which is hard to query on.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • jaanihsm Profile Picture
    300 on at
    Hi @Pstork1! Appreciate the response!
     
    Unfortunately, I will need to include the filter for Status = Completed. I tried using AddDays(UtcNow(), -28) but it did not return any results from the query. What did you mean by test separately? Sorry, a bit of a newbie...
     
    I have a similar code for Status = Pending and EndDate eq AddDays(UtcNow(), -21, 'MM/dd/yyyy') and is working well (EndDate column was manually created vs Modified column from SharePoint default).
     
    So could be that my Modified date/time format in the query is wrong? Do you have another recommendation? Greatly appreciate it!
     
     
  • jaanihsm Profile Picture
    300 on at
    My bad @Pstork1! It is working! I missed something on the code. Thank you so much for your time and support! 

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 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard