How to Copy Files in Power Automate + Examples

While working on Power Automate, you may need to copy files between different locations to automate tasks like archiving or sharing documents. Power Automate provides actions to copy files within SharePoint and OneDrive.

This tutorial will cover how to copy files in Power Automate across different platforms. You will learn to copy files within SharePoint libraries, between SharePoint sites, and OneDrive folders.

I will also explain how to copy files between OneDrive and SharePoint, including copying files to a Teams channel by leveraging the SharePoint “Create File” action.

Power Automate Copy File Action

The Copy File action in Power Automate allows you to copy a file from one location to another. This action is beneficial when automating file management flows across different document libraries, folders, or even systems (like SharePoint, OneDrive, or Local Storage). Here, you need to specify the source file location and the destination where you want the file copied. This action helps automate tasks like creating backups and archiving documents.

Power Automate provides two Copy File actions, one for SharePoint and another for OneDrive.

Power Automate Copy File Action From SharePoint Connector

The SharePoint Copy File action is used to copy files within or between SharePoint document libraries, including across different SharePoint sites.

Power Automate Copy File action accepts Parameters:

  • Current Site Address: Specify the SharePoint site where the source file is located.
  • File to Copy: Provide the File Identifier, which can be dynamically retrieved.
  • Destination Site Address: Specify the SharePoint site where the file will be copied. This can be the same site as the source or a different site.
  • Destination Folder: Define the folder path in the destination SharePoint site where the file should be copied.
  • If another file is already there:
    • Copy with a new name: Automatically rename the new file.
    • Fail this action: Stop the flow with an error.
    • Replace: Overwrite the existing file.
    • Custom value: You can specify a different behavior based on your needs.
Power Automate Copy File Action From SharePoint Connector

Power Automate Copy File Action From OneDrive for Business Connector

The OneDrive Copy File action is used to copy files within OneDrive or between OneDrive and other cloud services.

Power Automate Copy File action accepts Parameters:

  • File: Provide the full path to the file in OneDrive that you want to copy.
  • Destination File Path: Specify the full path to the destination folder and the file name in OneDrive.
  • Overwrite: Boolean value to determine whether to overwrite an existing file at the destination:
    • Yes: Overwrite the existing file.
    • No: Keep the existing file; the flow will fail if a file with the same name exists.
Power Automate Copy File Action From OneDrive Connector

Copy File From One SharePoint Library to Another using Power Automate

Suppose your organization manages project documents in a SharePoint document library named Active Project. Once a project status changes to “Completed,” the corresponding files must be copied to another Archived Projects library for record-keeping. Automating this process ensures no manual oversight and maintains an organized document structure.

For this example, I created two SharePoint document libraries:

Copy File From One SharePoint Library to Another 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 from sharepoint to sharepoint

2. Now, we will add the Condition action to check whether the Status is Completed or not.

In this Condition action, select the Status (from When a file is created or modified (properties only) action) value equal to Completed.

Copy File From One SharePoint Library to Another in Power Automate

3. Then, Add the copy file action inside the true section and provide the below parameters:

  • 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 a file is created.
  • 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, you can select as required.
Power Automate Copy File From One SharePoint Library to Another

Now click on Save and run the Flow manually. Once the flow runs, go to the SharePoint library and change the status to Completed.

Power Automate Copy File From One SharePoint Library to Another SharePoint Library

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

How to Copy File From One SharePoint Library to Another using Power Automate

How to Copy Files From One SharePoint library to Another using Power Automate?

Suppose you are managing files stored on a SharePoint library and need to copy these files to a different SharePoint library for backup. This automation ensures files are transferred seamlessly without manual downloads/uploads.

For this example, I created two SharePoint libraries:

Copy Files From One SharePoint Site to Another using Power Automate

I want to copy all files from the PDF Document to the Report Storage library. To do this, follow the steps below:

1. In the Power Automate, click the Instant Cloud flow, enter the Flow name, and choose the trigger flow (i.e., manually trigger a flow).

Copy Files From One SharePoint Site to Another in Power Automate

2. Add the Get files (properties only) action and provide the below parameters to retrieve all the files:

  • Site Address: Provide the SharePoint site where the source file is located.
  • Library Name: Select the library name.
Copy Files From One SharePoint library to Another using Power Automate

3. Then, Add the copy file action and provide the below parameters:

  • 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 Get files (properties only).
  • 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, you can select as required.
How to Copy Files From One SharePoint library to Another using Power Automate

Now, click save and run the flow manually after it runs successfully. Go to the Document library, you can see the file successfully copied.

How to Copy Files From One SharePoint library to Another in Power Automate

Copy File From One OneDrive Folder to Another using Power Automate

Suppose your team collaborates on documents within OneDrive for Business. Files are initially uploaded to a folder named Draft Files. Then, it must be copied to another folder named Ready for Review in the same OneDrive.

Copy File From One OneDrive Folder to Another 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 from the OneDrive for Business connector, Select the folder where the file was created.

Copy File From One OneDrive Folder to Another in Power Automate

2. Add Copy file action from the OneDrive for Business connector and provide below parameters:

  • File: Provide the file identifier from dynamic content.
  • Destination File Path: Provide the destination folder name and file name:
/Ready for Review/@{triggerOutputs()?['headers/x-ms-file-name-encoded']}
Copy File From One OneDrive Folder to Another Power Automate

Now click on Save and run the Flow manually. Once the flow runs, go to the OneDrive and upload a file.

Power Automate Copy File From One OneDrive Folder to Another

After the flow successfully goes to the OneDrive folder, you can see the file successfully copied.

How to Copy File From One OneDrive Folder to Another using Power Automate

Copy File OneDrive to SharePoint in Power Automate

Suppose your team uses OneDrive for preliminary file storage during collaboration. Once a file is finalized, it must be moved to a SharePoint library for organizational record-keeping and further use. For example, team members upload finalized project files to a Finalized Files folder in OneDrive, which must be copied to a SharePoint library named Project Resources.

Now follow the below steps:

1. Create an automated cloud flow. Give the flow name and select the trigger. When a file is created from the OneDrive for Business connector, Select the folder where the file was created.

Copy File OneDrive to SharePoint in Power Automate

2. Add Create file action from SharePoint Connector and provide below parameters:

  • SharePoint site address: Select the SharePoint site address.
  • Folder Path: Set the folder path of the document library.
  • File Name: Select Name from the dynamic content.
  • File Content: Select the File content from the dynamic content.
Copy File OneDrive to SharePoint using Power Automate

Now click on Save and run the Flow manually. Once the flow runs, go to the OneDrive and upload a file.

 Power Automate Copy File OneDrive to SharePoint

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

How to Copy File OneDrive to SharePoint in Power Automate

Copy File from SharePoint to OneDrive using Power Automate

In the above example, we saw how to copy a file from OneDrive to SharePoint. I will show you how to copy a file from SharePoint to OneDrive. In this example, we will use the same folder and library. Follow the steps below:

1. Create an automated cloud flow. Give the flow name and select the trigger. When a file is created (properties only). Also, provide the Site Address and Library Name.

Copy Files from SharePoint to OneDrive using Power Automate

2. Add a Get File content action from SharePoint Connector and provide below parameters:

  • Site Address: Provide the SharePoint site where the source file is located
  • File Identifier: Provide the Identifier from the dynamic content.
Create copied files in the OneDrive using Power Automate

3. Next, add Create file action from OneDrive for Business Connector and provide below parameters:

  • Folder Path: Select the folder where you want to copy the file.
  • File Name: Provide the file name from the dynamic content.
  • File Content: Provide the File Content from the dynamic content.
Copy Files from SharePoint to OneDrive in Power Automate

Now click on Save and run the Flow manually. Once the flow runs, upload a file to the SharePoint library.

Power Automate Copy Files from SharePoint to OneDrive

After the flow successfully goes to the OneDrive folder, you can see the file successfully copied.

How to Copy Files from SharePoint to OneDrive using Power Automate

Copy File from OneDrive to Teams using Power Automate

I want to copy a file to the ‘General’ folder of a Microsoft Teams channel whenever a file is created in a specific folder in OneDrive.

Did you know Teams file are stored in a behind-the-scenes SharePoint document library? Each Teams channel is linked to a SharePoint site where its file are stored.

This means copying file from OneDrive to Teams is essential: OneDrive -> SharePoint document library.

To achieve this in Power Automate, you must use the SharePoint connector to create the file in the SharePoint document library linked to the Teams channel.

Now follow the below steps:

1. Create an automated cloud flow. Give the flow name and select the trigger. When a file is created from the OneDrive for Business connector, Select the folder where the file was created.

Copy File OneDrive to SharePoint in Power Automate

2. Add Create file action from SharePoint Connector and provide below parameters:

  • SharePoint site address: Select the SharePoint site address.
  • Folder Path: Set the folder path of the document library.
/Shared Documents/General
  • File Name: Select Name from the dynamic content.
@{triggerOutputs()?['headers/x-ms-file-name-encoded']}
  • File Content: Select the File content from the dynamic content.
@{triggerBody()}
Copy Files from OneDrive to Teams using Power Automate

Save the flow and test it by uploading a file to the OneDrive folder.

Copy Files from OneDrive to Teams in Power Automate

Check the Teams channel to confirm the file has been copied.

How to Copy Files from OneDrive to Teams in Power Automate

Conclusion

In this tutorial, I covered various ways to copy files using Power Automate, focusing on automating file transfers between different platforms. Using the respective connectors, I explained how to copy files within SharePoint libraries, between SharePoint sites, and OneDrive folders.

Additionally, I explained how to copy files between OneDrive and SharePoint, highlighting the importance of using the SharePoint Create File action for Teams since Teams files are stored in SharePoint.

Also, you may like the below Power Automate tutorials:

  • Hi,

    If the file is opened in the browser while copying flow will fail error says locked mode. can you please check and update on that case?
    Thanks

  • What’s frustrating is its impossible to simply copy an excel file and rename. You can do it on OneDrive but useless when you need others to run the flow. Frustrating you can’t do the simplest things with automate.

  • Congratuilations for your work.
    Would it be possible to have an example of “Power Automate copy/move file from SharePoint Online to SharePoint On-premises”?
    Many thanks

  • >
    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…