Power Automate Copy File When a File is Created or Modified in SharePoint

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.

Copy File When File Created or Modified in SharePoint using power Automate

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.

Power Automate Copy File When File Created or Modified in SharePoint

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.
Copy File When File Created or Modified in SharePoint in power Automate

Now, click Save and run the flow manually. Once the flow runs, add a file in the Project Files document library.

Copy File When File Created in SharePoint using power Automate

After the flow successfully goes to the Archived Files Document library, you can see the file successfully copied.

Copy File When File Created in SharePoint in power Automate

Then, with another use, go to the Project Files document library and modify the Excel file.

Copy File When File Modified in SharePoint in power Automate

Afterward, when you go to the Archived Files Document library, you can see the file successfully copied with a different name.

How to Copy File When File Created or Modified in SharePoint using power Automate

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.

Copy File From SharePoint Library Folder using Power Automate

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
Copy File From SharePoint Library Folder in Power Automate

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.
Power Automate Copy File From SharePoint Library Folder

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.

How to Copy File From SharePoint Library Folder using Power Automate

After the flow runs successfully, go to the Power Automate Backups folder, and you will see that the file has been copied successfully.

How to Copy File From SharePoint Library Folder in Power Automate

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:

>
Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial

FREE Power Platform Tutorial PDF

Download 120 Page FREE PDF on Microsoft Power Platform Tutorial. Learn Now…