How to Move File from OneDrive to SharePoint using Power Automate?

Do you want to move file from Onedrive to SharePoint in a minute? In this Power Automate tutorial, we will see how to move files from OneDrive to SharePoint using Power Automate.

If you want to move all the files from OneDrive to a SharePoint document library, I have also done a complete flow on that.

Power Automate move file from OneDrive to SharePoint

Here we will see how to move a file from OneDrive to SharePoint using Power Automate.

For example, we have a folder in the Document library called Project Documents in OneDrive. In this folder, the project team stores the Project documents for review and approval. Once it is approved and reviewed we will move this document to the SharePoint library for long-term storage.

So, below you can see the Project Document folder in the Documents library in OneDrive.

power automate move file from onedrive to sharepoint

This is my SharePoint library, where we will store the Project Documents.

Microsoft power automate move file from onedrive to sharepoint

Let’s create a flow, that will move files from OneDrive to SharePoint using Power Automate.

Step 1: Open Power Automate Cloud, then click on +Create -> select Automated Cloud Flow.

Microsoft power automate move file from onedrive to sharepoint Online

Then provide the flow name and select the ‘When a file is created action from OneDrive for business. Then click on Create.

power automate move file from onedrive to sharepoint Online

Now, the’ When a file is created‘ action is added to the flow page. Then provide the below information:

  • Folder: Select the Folder path.
copy file from onedrive to sharepoint power automate

Step 2: We will create a shareable link which we will share while asking for approval, for this, click on the +New step and select the ‘Create Share link’ action. Then provide the below information:

  • File: Provide the File identifier from dynamic content
  • Link type: Select the Link type as view.
  • It will automatically choose the Anonymous option.
How to copy file from onedrive to sharepoint power automate

Step 3: We will send the document for approval, click on the +New step -> select ‘Start and wait for an approval action. Then provide the below information

  • Approval type: Select the type as ‘Approve/Reject – First to respond’
  • Title: Provide the title like below.
  • Assigned to: Provide the person’s email who will approve the document.
  • Details: Provide the details related to the document
  • Item link: Provide the Shareable link from dynamic content.
move file from onedrive to sharepoint power automate

Step 4: Next, we will check whether the document is Approved or not, for this click on the +New step -> select Condition action. Then provide the below information:

  • Choose a value: Select the Outcome from dynamic content.
  • Operator: Select the operator as equal to
  • Choose a value: Provide the value as Approved.
How to move file from onedrive to sharepoint power automate

Step 5: If the above condition is true that means the document is approved and we can move a file from Onedrive to SharePoint.

See also  How to Format Numbers to Decimal Places Using Power Automate?

For this in the If Yes part of the condition, click on Add an action -> select Create file action. Then provide the below information.

  • Site address: Provide the SharePoint site address
  • Folder path: Provide the Folder path where the document gets created.
  • File name: Provide the file name from dynamic content
  • File content: Provide the file content from dynamic content.
How to move file from onedrive to sharepoint using power automate

Step 6: Now run the flow manually and upload a file in the folder of the OneDrive Document library.

How to move file from onedrive to sharepoint using Microsoft power automate

After that, you can see your flow runs successfully and a file is moved to the SharePoint library.

How to move file from onedrive to sharepoint in power automate

This is how to move a file from OneDrive to a SharePoint document library using Power Automate.

Move all files from One Drive to SharePoint using Power Automate

Here we will see how to move all files from OneDrive to SharePoint using Power Automate.

In some cases, we need to move all files from OneDrive to SharePoint, but it takes a lot of time to do this task. For this, we will create a flow in Power Automate that will quickly move all files from OneDrive to SharePoint.

For example, I have a folder in One Drive called Invoices, and I need to move all my files to the SharePoint library called Invoices.

For this, I have created an Instant Cloud Flow, that will get all files from the Folder in One Drive and then Move the files to SharePoint in Power Automate.

Below the image, you can see the Invoice folder in One Drive.

How to move all files from onedrive to sharepoint in power automate

Here you can see the SharePoint Invoice Library.

move all files from onedrive to sharepoint in power automate

Now, let’s create the flow that will move all files from One Drive to SharePoint using Power Automate.

See also  How to Create and Delete an Item from a SharePoint List using Power Automate Desktop?

Step 1: Open Power Automate Cloud, then click on +Create -> select Instant Cloud Flow.

move all files from onedrive to sharepoint in Microsoft power automate

Then provide the flow name and select the “Manually trigger a flow” action. Then click on Create.

move all files from onedrive to sharepoint  Microsoft power automate

Now, you can see the “Manually trigger a flow” action is added to the flow page.

move all files from onedrive to sharepoint  using Microsoft power automate

Step 2: Next, we will get all files from the OneDrive folder, for this, click on the +New step -> select List files in folder action. Then Provide the information below:

  • Folder: Provide or select the folder path.
move all files from onedrive to sharepoint using power automate

Step 3: We will get the file content of each file, for this, click on the +New step -> select ‘Get file content‘ action. Then provide the below information:

  • File: Select the ID from the dynamic content. This will automatically add Apply to each action.
How to move all files from onedrive to sharepoint using power automate

Step 4: At last, we will move a file to SharePoint, for this, click on the Add an action, then select Create file action. Provide the below information:

  • Site address: Provide the SharePoint Online site address
  • Folder path: Provide the Folder path where the document gets created.
  • File name: Provide the file name from dynamic content
  • File content: Provide the file content from dynamic content.
How to copy all files from onedrive to sharepoint using power automate

Step 5: Now we will run the flow, you can see your flow run successfully, and all files moved from OneDrive to SharePoint using Power Automate.

How to move all files from onedrive to sharepoint power automate

This is how to move all files from OneDrive to SharePoint using Power Automate.

Conclusion

In this Power Automate tutorial, we saw how to move a file from One Drive to SharePoint using Power Automate. Also, we saw how to move all files from OneDrive to SharePoint using Power Automate.

See also  How to Get and Delete a SharePoint list view using Power Automate?

You may like the following tutorials:

  • Would be good to know how to replace a superseded file with the same name (overwrite) already in the SharePoint library, when moving from OneDrive. My Flow fails when there is already a document there with the same name…I need it to replace the older file with the newer file.

  • >