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 SP items beyond...
Power Automate
Unanswered

Delete SP items beyond a certain date

(1) ShareShare
ReportReport
Posted on by 175

Hi all,

 

I have a continuously growing SharePoint list which gets updated daily very frequently. I am using it to display the status of a production build. However, sometimes a record is accidentally duplicated, or not used properly, etc. In these cases, the status will not change at the end of the day.

 

Is there a way to delete old records that have been unaltered (status: "Planned") and the default "Created" column being more than 3 days old? 

 

To summarize: I need a flow that will:

 

  • Get Items from an SP List (filter query: Status = "Planned" and Created = more than three days ago
  • Delete these items

 

I'm not sure how to check dates within MS Flow. Please let me know!

 

Farhan

Categories:
I have the same question (0)
  • Gristy Profile Picture
    2,429 on at

    Hey,

     

    Yes you pretty much have it with your post.

     

    The only bit you need to do is work out what date you want to delete prior to.

     

    Use action Get files (properties only)

     

    Status eq 'Planned' AND Created le '@{formatDateTime(utcNow(),'yyyy-MM-dd')}'

     

    This will delete anything created before NOW, but you should replace utcNow() with your own date object.

  • MattWeston365 Profile Picture
    1,701 on at

    Hi @farhandsome 

     

    If you're just looking for items/files that are older than the last three days, then you can set your Filter query as:

    Status eq 'Planned' and Created le '<addDays(utcNow(),-3)>'

     

    eq = Equals

    le = Less than or Equal

     

    The elements in the chevrons <> are an expression, and so your action will appear like this:

    Example.PNG

    What I would be careful of though is using the Created date, as that will remain static for all items (unless you have a custom Created Date column). You may actually be better working off the modified, so if the item hasn't been updated in three days, then you can remove it.

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

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard