Automations 5 min

Copy SharePoint Files with Power Automate

Short answer

You can copy files between SharePoint libraries with Power Automate by combining the 'When a file is created' trigger with the 'Get file content using path' and 'Create file' actions. For manual copying, use the 'For a selected file' trigger instead. To move rather than copy, add a 'Delete file' action after the copy is confirmed successful.

Automatically copy or move files between SharePoint libraries using a trigger-based or manual Power Automate flow.

When Automatic File Copying Is Useful

Many organisations use multiple SharePoint libraries for different stages of a process: one for incoming documents, one for reviewed and approved files, and one for archived records. Manually moving files between these stages is repetitive and easy to forget.

A Power Automate flow can handle the movement automatically. Common scenarios include copying a completed contract from a team’s working library to a central contracts archive, moving approved invoices from the accounting team’s inbox library to the accounts payable processing folder, and syncing files uploaded by external partners into an internal project library.

The approach depends on whether copying should happen automatically when a file arrives, or when a user explicitly triggers it for a specific file.

Trigger Options: Automatic vs. Manual

Automatic trigger: “When a file is created (properties only)” fires whenever a new file is uploaded to the source library. This is the right choice when every new file should be copied, without any human decision involved. Note that this trigger fires only on file creation, not on edits, which prevents the flow from running repeatedly as someone works on a document.

Manual trigger: “For a selected file” lets users right-click a file in SharePoint and choose to run the flow from the context menu. This is better when copying is conditional: a reviewer might copy only the files they have approved, leaving others in place. Users see the flow listed under “Automate” in the SharePoint file menu after the flow is published.

For scheduling-based scenarios, such as copying all files created in the past 24 hours at midnight, see scheduled flows in Power Automate.

Getting the File Content and Creating the Copy

After the trigger, add the SharePoint action Get file content using path. In the Site Address field, select the source site. In File Path, use the dynamic value Full Path from the trigger output. This step retrieves the binary content of the file, which is needed to create an identical copy.

Next, add the Create file action and point it at the destination site and library. Set:

  • Folder Path: the destination folder path (you can use a static path or build a dynamic one)
  • File Name: the dynamic value File name with extension from the trigger
  • File Content: the File content output from the “Get file content using path” step

The file now exists in both the source and destination libraries.

Moving Files Instead of Copying

To move a file (copy then delete the original), add one more action after the “Create file” step: the SharePoint action Delete file. Use the Identifier (file ID) from the original trigger as the item to delete.

Always place the delete step after the copy step confirms success. If you are using error handling in Power Automate, wrap the delete in a condition that checks whether the “Create file” action succeeded. This prevents the original file from being deleted if the copy failed, which would result in losing the file entirely.

A safe pattern is to add a Condition that checks outputs('Create_file')?['statusCode'] equals 201 (Created) before running the delete. If the create did not return 201, send an email notification instead.

Testing and Activating

Before switching the flow on for production, test it manually. Upload a small test file to the source library. In Power Automate, open the flow and click Test, then select Manually and trigger the test. The run detail page shows each step’s result in real time.

Verify that the file appears in the destination library with the correct name and content. If you added a delete step, confirm the original is removed only after the copy is visible. Once satisfied, turn the flow on. Future file uploads will trigger it automatically without any further action.

Our tip: Add a “Send an email notification” step at the end of the flow so the relevant person is informed when a file has been copied or moved. Even a brief email saying “Invoice_Q3.pdf has been moved to Accounts Payable” saves people from manually checking whether the flow ran. It also gives you a lightweight audit trail in your inbox without needing a separate logging system.

Frequently asked questions

Can I copy a file only if it meets certain conditions, such as a specific file type or folder?

Yes. After the trigger, add a Condition action. You can check the file name using `endsWith(triggerOutputs()?['body/{FilenameWithExtension}'], '.xlsx')` to match only Excel files, or check the folder path with `contains(triggerOutputs()?['body/{Path}'], '/Approved/')` to match only files in a specific subfolder. When the condition evaluates to true, the copy actions run; otherwise the flow ends without doing anything. This pattern keeps your flow selective and prevents unnecessary copies filling up the destination library.

What is the difference between 'When a file is created' and 'When a file is created or modified'?

The trigger 'When a file is created (properties only)' fires only once, when a new file is first uploaded to the library. 'When a file is created or modified (properties only)' fires on every save, which means editing an existing file also triggers the flow. For copying purposes, the 'created only' trigger is usually correct: you want the copy to happen once when a file arrives, not every time someone opens and saves it. If you need to sync edits to a backup location, use the 'created or modified' trigger, but be aware it will run frequently for actively edited files.

How do I preserve the SharePoint metadata (columns) when copying a file?

The 'Create file' action only copies the file content, not the custom metadata columns of the source library. To copy metadata as well, you need additional steps. After creating the file, use the 'Update file properties' action and map each column value from the trigger's properties output to the corresponding column in the destination library. If the destination library has different column names, you map them manually. For large-scale migrations with many metadata fields, the SharePoint Migration Tool or the PnP PowerShell module are more practical than Power Automate.

Want a dashboard or automation built for you?

Stuurboard BI builds custom Power BI dashboards and workflow automations. Pragmatic, fast, and without the fuss.