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.
This is my SharePoint library, where we will store the Project Documents.
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.
Then provide the flow name and select the ‘When a file is created action from OneDrive for business. Then click on Create.
Now, the’ When a file is created‘ action is added to the flow page. Then provide the below information:
- Folder: Select the Folder path.
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.
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.
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.
Step 5: If the above condition is true that means the document is approved and we can move a file from Onedrive to SharePoint.
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.
Step 6: Now run the flow manually and upload a file in the folder of the OneDrive Document library.
After that, you can see your flow runs successfully and a file is moved to the SharePoint library.
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.
Here you can see the SharePoint Invoice Library.
Now, let’s create the flow that will move all files from One Drive to SharePoint using Power Automate.
Step 1: Open Power Automate Cloud, then click on +Create -> select Instant Cloud Flow.
Then provide the flow name and select the “Manually trigger a flow” action. Then click on Create.
Now, you can see the “Manually trigger a flow” action is added to the flow page.
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.
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.
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.
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.
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.
You may like the following tutorials:
- How to Send an Email with Attachments in Power Automate?
- Download files from SharePoint to Local Drive using Power Automate
- How to Merge Pdf files in Power Automate Desktop?
- How to merge pdf files in Power Automate?
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com
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.
Thank you Bijay, you really helped me. I hope your business is very successful.