Power Automate Copy Files from OneDrive to SharePoint

This Power Automate tutorial will help you copy files from OneDrive to SharePoint using Power Automate. Here, I will show you two different examples of copying files from OneDrive to SharePoint using Power Automate.

I will show you two examples here. In the first example, the flow triggers manually and copies all files from OneDrive to the SharePoint document library using Power Automate.

In the other example, the flow triggers automatically and copies files automatically from OneDrive to SharePoint using Power Automate flow.

Copy Files from OneDrive to SharePoint using Power Automate

Let us see how to copy files from OneDrive to SharePoint using Power Automate.

Example-1: (Copy all files from OneDrive to SharePoint)

In this example, I am going to copy all the files that are presented HR Documents library in OneDrive by a flow.

power automate copy file from onedrive to sharepoint

In SharePoint Online, I have created a document library called HR Documents as shown below:

copy file from onedrive to sharepoint power automate

Here we will create a button flow, and when a user clicks on it, the files will be moved from the OneDrive HR Documents library to the SharePoint HR Documents Library.

To achieve this, follow the below steps:

Step-1:

Create an instant cloud flow, Then select ‘Manually trigger a flow‘ to trigger the flow manually.

  • Then add +newstep and select the List file in Folders action from OneDrive for business action triggers.
  • In the Folder, select the Source Folder path by using Show Picker.
power automate move file from onedrive to sharepoint

Step-2:

  • Then, we will add a Get file content action to get the content of a file. Here we will Pass the File ID from the dynamic content of the previous action i.e. list files in the folder.
  • It will automatically create an apply to each control to loop through each file presented in the HR Documents OneDrive Folder.
move files from onedrive to sharepoint power automate
  • Add a new step and select the create file action for SharePoint. Provide the below details:
    • Site Address – Choose the SharePoint site from the dropdown
    • Folder Path – Select the folder from the Show Picker where you want to store the copied files (I have selected the HR Documents)
    • File Name – Pass the Dynamic content value Name for the file name
    • File Content – Add File content from the dynamic content value.
power automate onedrive to sharepoint

Step-3:

See also  Power BI Bar Chart Show Value and Percentage

Save and run the flow by selecting the run flow option. Once flow ran successfully like below:

move file from onedrive to sharepoint power automate

In the below screenshot, we can see it copies all the files from OneDrive to the SharePoint document library.

copy files from onedrive to sharepoint power automate

This is how to Copy all Files from OneDrive to SharePoint using Power Automate.

Example-2: (Copy file from OneDrive to SharePoint)

In this example, I am going to copy files automatically from OneDrive to SharePoint using flow.

Whenever a new file is added to the OneDrive Employee Documents automatically the created file should be copied to the SharePoint document library.

The below screenshot displays the Employee Documents folder presented in OneDrive.

power automate copy from onedrive to sharepoint

Similarly, I have a SharePoint document library called Employee Documents as shown below:

copy file from one drive to sharepoint using power automate

Here we will create an automated cloud flow so that whenever a new file is added to the OneDrive Employee Documents library it will automatically copy the created file to the SharePoint Employee Documents Library.

To achieve this, follow the below steps:

Step-1:

Create an Automated cloud flow, and choose the trigger When a file is created, In the Folder section, from the show picker select the Employee Documents as shown below:

move files from onedrive to sharepoint using power automate

Step-2:

Add a new step and choose the create file action for SharePoint. Provide the below details:

  • Site Address – Choose the SharePoint site from the dropdown
  • Folder Path – Select the folder from the Show Picker where you want to store the copied files (I have selected the Employee Documents)
  • File Name – Pass the Dynamic content value Name for the file name
  • File Content – Add File content from the dynamic content value.
power automate copy file from sharepoint to onedrive

Step-3:

See also  Connect to SharePoint Online Site using PowerShell

Save and run the flow by selecting the run flow option. Here I have uploaded a file called (Grady.pdf) in the OneDrive Employee Documents highlighted below:

copy file from onedrive to sharepoint in power automate

Once the flow runs successfully like below:

how to copy files from onedrive to sharepoint

Automatically, the uploaded file is copied from the OneDrive document library to the SharePoint document library.

In the below screenshot, we can see it copies the Grady.pdf from OneDrive to the SharePoint document library.

power automate copy file from onedrive to sharepoint

This is how to Copy Files from OneDrive to SharePoint using Power Automate.

Conclusion

I hope you get an idea of copying files from OneDrive to SharePoint using Power Automate.

Here I have shown you two different examples of copying files from OneDrive to SharePoint. In the first example, I showed you how to copy all the files from OneDrive to SharePoint in Power Automate.

In the second example, I showed you how to copy files from OneDrive to SharePoint whenever a new file is added to the OneDrive documents library using Power Automate.

You may also like:

>