How to Automatically Archive OneDrive Files by Date
Question details
The user wants to know how to automatically archive files in a specific OneDrive folder based on their creation or modification dates and schedule them for eventual deletion.

- Product
- Microsoft OneDrive
- Device & OS
- not provided
- Scenario
- Managing file lifecycles and organizing cloud storage by automatically moving older files to an archive or scheduling them for deletion.
- Observed behavior
- OneDrive does not have a native, built-in feature to automatically archive or delete files based on their age or modification date.
Ensure you have an active Microsoft account with access to both OneDrive and Microsoft Power Automate, and verify that you have sufficient permissions to create automated cloud flows.
Use Power Automate to Create an Archiving Flow
Since OneDrive does not support native date-based archiving, you can use Microsoft Power Automate to build a scheduled flow that checks file dates and moves qualifying files to an archive folder.
Power Automate (formerly Microsoft Flow) allows you to connect different Microsoft services. By creating a scheduled flow, you can set custom parameters to evaluate the creation or modification dates of files within a designated OneDrive folder and automate their relocation.
Go to the Microsoft Power Automate website and sign in with your Microsoft account credentials.
Click on 'Create' in the left sidebar and select 'Scheduled cloud flow'. Name your flow and set the frequency (e.g., daily or weekly) for when the archive check should run.
Add a new step and search for the 'OneDrive for Business' or 'OneDrive' connector. Select the 'List files in folder' action and specify the path to the folder you want to monitor.
Add an 'Apply to each' control to loop through the listed files. Inside the loop, add a 'Condition' to check if the 'Last modified' or 'Created' date is older than your specific archiving threshold (using expressions like 'addDays').
In the 'If yes' branch of your condition, add the 'Move or rename a file' action. Specify the dynamic file ID and set the destination path to your designated archive folder.

Try WPS Office for Your Document Management Needs
While you set up your OneDrive automations for file archiving, consider using WPS Office for your daily document creation. It is a free, lightweight, and highly capable alternative to Microsoft Office that offers a familiar interface, seamless migration, and robust file compatibility.
- 1. Download WPS Office: Visit the official WPS Office website and click the free download button for your operating system.
- 2. Install the Application: Run the downloaded installer file and follow the simple on-screen instructions to set up the software.
- 3. Edit Your Cloud Files: Launch WPS Office, open your Microsoft Office format files, and enjoy a seamless editing experience.

Frequently Asked Questions
Does OneDrive have a built-in auto-archive feature?
No, OneDrive does not natively offer a built-in setting to automatically archive or delete files based on their creation or modification dates. You must use Microsoft Power Automate to achieve this.
Can I automatically delete old files in OneDrive?
Yes, but it requires setting up a scheduled workflow in Power Automate. You can configure a flow to scan a folder and use the 'Delete file' action for any files older than a specified number of days.
Is Power Automate free to use with OneDrive?
Power Automate offers a free tier that is included with most standard Microsoft accounts. This tier is generally sufficient for basic personal OneDrive file management flows, though advanced integrations may require a premium subscription.




