3

I have a large list that (~4500 items) that I want to delete everything that is older than a certain value. Currently I have a view that filters off a target completions date that is past 60 days. I exported everything on that list to an excel file and now I want everything that is in that view gone. Is there a specific way I can delete everything just in that view?

Edit: I do not have access to powershell. I should've clarified: is there a built in way to do it without any coding?

  • You can use PowerShell as explained in this post sharepoint.stackexchange.com/q/16024 – Amal Hashim Mar 17 '17 at 17:33
  • 1
    There are so many ways to deal with this, but it all depends on your circumstances. Questions like this has to be answered first. 1) Do you have PowerShell access to the site? If yes, then Amal's recommendation is spot on. If no... 2) Is your farm in SharePoint Online (365)? If yes but no PowerShell server-side access, then you can use CSOM or REST APIs with PowerShell locally. 3) If no PowerShell at all, then workflow becomes your next best option. Items can have an expression workflow that rehydrates itself daily checking if expression has been reached. – Cornelius J. van Dyk Mar 17 '17 at 17:47
3

You can set up a retention policy on the library. There's a few mouse clicks involved, but the general idea is that you can configure an action based on any date field of an item. So you can delete an item when it hits createdDate + 2 years, for example. This feature can be found in library settings --> information management policy settings.

Just a quick note on testing: this feature runs via a timer job, so testing it is challenging. You set it up, and then wait a week.

There are lots of resources on this, including this one

edit: the official doc for creating these policies is here

  • This is the best approach. Information Management Policies are the way to go. – iOnline247 Mar 18 '17 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.