Automatic archiving of SharePoint documents with Power Automate

In dit artikel

Managing documents in SharePoint can quickly become overwhelming, especially when documents are no longer actively used over time. In this article, you will learn how to set up automatic archiving for SharePoint documents using Power Automate. This helps BI teams streamline their document management and ensures better organization and compliance with retention policies.

 

What you need

  • A SharePoint document library with documents that need to be archived
  • An archive folder or library within SharePoint where documents will be moved
  • A Power Automate flow with access to the SharePoint connector
  • An archiving criterion, for example, documents older than a certain date or with a specific status

 

Step 1: Set trigger for periodic check

The first step is to set a trigger that activates the flow periodically, for example weekly or monthly. This ensures the flow automatically checks which documents meet the archiving criteria.

Use the trigger “Schedule – Recurrence” in the Power Automate portal. Set the frequency to, for example, 1 week and the start time as desired.

 

Step 2: Retrieve documents that meet the archiving criteria

Add an action “SharePoint – Get items” and configure it to retrieve documents from the relevant document library. Use a filter query to only retrieve documents older than, for example, 1 year. This can be done with an OData filter such as:

Modified lt '@{addDays(utcNow(), -365)}'

This retrieves only documents that were modified more than 365 days ago.

 

Step 3: Move documents to the archive folder

Use an “Apply to each” action to loop through the retrieved documents. For each document, add the action “SharePoint – Move file”. Set the source URL and file name based on the dynamic content of the retrieved item. Choose the archive folder or library as the destination.

This ensures all selected documents are automatically moved and archived.

 

Tips & common mistakes

  • Ensure the archive folder has sufficient permissions for the flow to move files.
  • Test the flow first with a small dataset to avoid unintended loss of documents.
  • Use clear naming conventions in the archive folder to easily find documents.
  • Note that moved documents are no longer available in the original library, which may impact ongoing processes.

 

Example: Archiving old project documents

Suppose you have a SharePoint library with project documents. With this flow, you automatically archive all documents that have not been modified for over a year to a separate archive library. This keeps the active library organized and old documents safely stored.

 

Conclusion

With this automatic archiving of SharePoint documents in Power Automate, you keep your SharePoint document management efficient and organized. Want to learn more about automating processes? Then also check out the article Apply an approval process in Power Automate. Easily set this up via the Power Automate portal and optimize your workflows.

More posts

Looking for help?

We love to help you!

Feel free to contact us.

Foto van Brendan den Hartog

Author

Stijlelement

Spreek een van onze Power Platform Experts

CTA Plan een demo
Stijlelement