I have created a document library which has a few documents in it.

I have created a list which has items with the same names as the document's in the document library, and there is a column called expiry in list.

Now my documents in document library has to be deleted once the expiry date is passed, how can this be done?


You can create a custom timer job in sharepoint that will scan the documents in that document library and delete the documents according to expiry date.

You can set the interval of the timer job as per your requirement.

To create timer jobs you can check:



As always there's multiple options:

Retention Policy
If the expiry column had been on the document library itself and you're using SharePoint Server, then the right way to do this would be to specify a Retention Policy see: Applying Document Retention in SharePoint 2010

Timer Job
A nightly timejob as described by @user2861804 could do the job.

A workflow could be set to Wait until Expiry and then delete the document.

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.