“How can I take all the videos currently stored in users OneDrive and copy them to a SharePoint site using Power Automate?”
There’re two places where you can store files in the M365 platform. You can use OneDrive as a personal storage or SharePoint as a shared one. But sometimes the distinction is not that clear. Some files that should be in SharePoint are still in OneDrive of one specific user and shared to everyone else. Which is not a good approach – shared files should be in a shared location. And Power Automate can copy them for you.
Get the file from OneDrive
The standard approach would be to ‘Get file content’ and use it to create the file in SharePoint. But this action has 2 problems. Firstly, you can’t access other user’s OneDrive. And secondly, you can’t get a content of files bigger than 500 MB.
Since this approach won’t work, you should take one step back. OneDrive is basically a SharePoint document library hidden behind a different look (same as team in Teams). That means you can use also the SharePoint actions to access OneDrive.
Use the SharePoint actions
Using the SharePoint actions ‘Copy file’ or ‘Move file’ solves these two problems. You can access files on other user’s OneDrive (only the ones that are shared with you) and you can copy even big files.
Add the ‘Copy file’ action and configure it as below.
Current Site Address
This is the address of the user’s OneDrive which you can get from the url. Open your OneDrive in a browser and copy the address until the /_layouts. It should end with the owner’s email address with replaced characters @ and . (and maybe more).
On the screenshot below it’s the OneDrive that belongs to a user dev@tomriha.com
Take the url, change the email address, and use it as the Current Site Address.
File to Copy
The second field is the path to the file you want to copy. As already said, it has a SharePoint site on the background so you can’t use just the visible folder path. You must include also the library where the file is stored. It’ll be probably ‘Documents’ library, but you can confirm again using the url. Open any folder in the OneDrive and check the url, it’ll have the library name near the end.
The screenshot below is url address to a folder called Diving.
Take the document library, combine it with the visible path leading to the file, and use it as the File To Copy.
The remaining fields
Fill the destination fields with the desired SharePoint site location and you’re done. The flow will take a file from that OneDrive and store it in a SharePoint site.
Summary
You should remember that OneDrive is just a SharePoint site with a different look, and the process to copy files is similar to other file copying Power Automate flows. The tricky part is that you must know the exact name of the file and on whose OneDrive it’s located. Once you have this information (and the file is shared with you) you can easily take it from there.
using tools like Goodsync, Sharegate or Gs Richcopy 360 make the transfer from OneDrive to SharePoint more easy and fast
Thank you for providing this brilliant solution. Unfortunately, I am using SharePoint 2019 on-premises, which means that the “Copy file” action is not supported. I attempted to replace it with an HTTP request, but it appears to be ineffective. I would greatly appreciate any assistance you can provide in resolving this issue.
Hello Ashish,
I don’t work with on-premises SharePoint anymore, sorry.
Thanks for this, helped me solve an issue.
In reference to another project I have I was wondering if you’ve been able to do this successfully the other way. I would like to send files from SharePoint to the OneDrive of another person. The Power Automate user has had the folder shared to them with Edit access even though they’re not the owner.
When I try that I get the error:
“Missing or mismatched field definition on the destination list for source field ‘Send’ type ‘Text’. Source site template id ‘TeamCollaborationSite’, target site template id ‘MySitePersonalWebTemplate’. “
Hello Courtney,
I never did this so no advice here.
Hi,
I have a business OneDrive that gets a folder from a JotForm. I am trying to get the folder and its contents moved to a different SharePoint site. The flow works except for the URL for current site address. Says it doesn’t recognize it. The email strategy doesn’t work with this. Any ideas? Thank you
Hello Tobeornot,
I never used JotForm, so maybe it’s just a folder mapped to OneDrive that’s actually located elsewhere? If it’s on OneDrive it should work as explained.
Tom,
I am so thankful for you! This worked a treat!
The build I’m working on transfers confidential recordings from Teams. The flow worked nicely for a few weeks, until a longer meeting hit the 500MB limit . After multiple fruitless searches and attempted workarounds, I finally found this post.
The information you share has saved me so many hours of work in the past – I should have checked here first!
You’re truly a credit to the community.
Thank you,
Jeremy
This sounds like the exact approach I need (copy from OneDrive personal to a SharePoint site), but when I try either Copy file or Get files (the SharePoint actions) and use the personal OneDrive URL, the flow doesn’t see any items. Seems odd because I can browse the OneDrive structure in a browser using the same account as the flow’s connection. Any suggestions?
Thanks,
Tom