Sharepoint 365 Library Based Retention Schedule

Paul Cookman 41 Reputation points
2020-08-27T07:45:55.423+00:00

Hi,

I have setup a 365 Sharepoint Library Based Retention Schedule and set it to Library and Folders.

I then setup the retention to delete anything created + two days to move to the recycle bin.

A couple of weeks later and still the documents remain in the library, any ideas?

Regards.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
6,015 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JoyZ 17,901 Reputation points
    2020-08-28T05:13:32.447+00:00

    Information Management Policy and Expiration Policy are the two weekly timer jobs that make the policy work.

    In SharePoint online, timer jobs are controlled by Microsoft, we need to wait until the timer jobs run.

    Please go to SharePoint Designer->site Options, check the timer jobs' last run time through “dlc_PolicyUpdateLastRun” and “dlc_ExpirationLastRun” parameters.

    As a workaround, we could use flow to automatically delete files in Document Library after X days:

    21097-828-1.png

    Detaileds Steps:

    1. Use an schedule trigger with 1 day interval(you could change it as needed).
    2. Use the action - SharePoint - Get file properties only. Put your Site and Document Libary name
    3. Use an foreach and put values as result.
    4. Use an advanced condiction to verify if the actual date is greater than document created date + 2 @greater(utcnow('yyyyMMdd'), formatDateTime(addDays(item()?['Created'], 2), 'yyyyMMdd'))
    5. If the condiction is yes, the document is older than 2 days.
    6. Use the action - SharePoint - Delete Item.

    If the response is helpful, please click "Accept Answer" and upvote it.