In this Power Automate tutorial, I will show you how to copy a file when it is created or modified in SharePoint using Power Automate. Additionally, I will tell you how to copy a file from a SharePoint library folder using Power Automate.
Power Automate Copy File When a File is Created or Modified in SharePoint
Imagine you have two SharePoint document libraries, Project Files and Archived Files. Whenever a file is created or modified in the Project Files library, it should automatically be copied to the Archived Files library for backup purposes.
Now follow the below steps:
1. Create an automated cloud flow. Give the flow name and select the trigger When a file is created or modified (properties only). Also, provide the Site Address and Library Name.
2. Add the Copy file action and provide the parameters below to copy the file from the Project Files library to the Archived Files library:
- Current Site Address: The SharePoint site address where the file you want to copy is located.
- File to Copy: provide the identifier from dynamic content when creating a file.
- Destination Site Address: The SharePoint site to which you want to copy the file.
- Destination Folder: Select the destination SharePoint library.
- If another file is already there: Selcte Replace, Copy with a new name.
Now, click Save and run the flow manually. Once the flow runs, add a file in the Project Files document library.
After the flow successfully goes to the Archived Files Document library, you can see the file successfully copied.
Then, with another use, go to the Project Files document library and modify the Excel file.
Afterward, when you go to the Archived Files Document library, you can see the file successfully copied with a different name.
Copy File From SharePoint Library Folder Using Power Automate
Suppose you have a SharePoint document library named Power Platform Files, which stores files related to Power Platform solutions. You have the following folders within the library: Power Automate Solutions and Power Automate Backups.
I want to create a Power Automate flow that automatically copies any new file added to the Power Automate Solutions folder into the Power Automate Backups folder for backup purposes.
To do this, follow the below steps:
1. Create an automated cloud flow. Give the flow name and select the trigger When a file is created or modified (properties only). Also, provide the Site Address and Library Name. Specify the folder path as:
/PowerPlatformFiles/Power Automate Solutions
2. Add the Copy file action and provide the parameters below to copy the file from the Project Files library to the Archived Files library:
- Current Site Address: The SharePoint site address where the file you want to copy is located.
- File to Copy: provide the identifier from dynamic content when creating a file.
- Destination Site Address: The SharePoint site to which you want to copy the file.
- Destination Folder: Select the destination SharePoint library Folder:
/PowerPlatformFiles/Power Automate Backups
- If another file is already there: Selcte Replace, Copy with a new name.
In Power Automate, click Save to ensure all changes are updated. Then click Test, select Manually to test the flow, and click Test to proceed. Afterward, go to your SharePoint document library named Power Platform Files, navigate to the Power Automate Solutions folder, and upload a new file.
After the flow runs successfully, go to the Power Automate Backups folder, and you will see that the file has been copied successfully.
Conclusion
In this tutorial, I explained how to automate copying files from one SharePoint document library folder to another using Power Automate. Specifically, I showed how to create a flow that triggers when a file is created or modified in the Power Automate Solutions folder within the Power Platform Files library. The flow then automatically copies the file to the Power Automate Backups folder for backup purposes.
Additionally, I explained how to set up the flow to handle new files and modified files, ensuring they are copied to the backup folder with the correct settings, such as overwriting existing files or giving them new names.
You may also like:
- Power Automate Copy Folder
- Copy SharePoint Files From One Tenant to Another Tenant Using Power Automate
- Copy New Files from Your PC to SharePoint using Power Automate
- Copy List Items To Another List In SharePoint Using Power Automate
- Power Automate vs Nintex: Key Differences for Workflow Automation
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com