Skip to content

Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Problems
  • Triggers
  • Application specific solutions
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Resources
Menu

Copy files from user OneDrive to SharePoint using Power Automate

Posted on July 17, 2022July 17, 2022 by Tom

“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.

Power Automate copy onedrive sharepoint

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.

Power Automate copy onedrive sharepoint
Power Automate copy onedrive sharepoint

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.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Now available:

The Ultimate Power Automate expressions cheat sheet
Equip yourself with the tool to translate your thoughts into Power Automate expressions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Hello and welcome!

My name is Tom and I'm a business process automation consultant and Microsoft MVP living in the Czech Republic. I’ve been working with Microsoft technologies for almost 10 years, currently using mainly Power Automate, SharePoint, Teams, and the other M365 tools.

I believe that everyone can automate part of their work with the Power Automate platform. You can achieve a lot by "clicking" the flows in the designer, but you can achieve much more if you add a bit of coding knowledge. And that's what this blog is about.

To make the step from no-code Power Automate flows to low-code flows: using basic coding knowledge to build more complex yet more efficient flows to automate more of your daily tasks.

  • Check if email already exists in Outlook contacts (Power Automate)August 7, 2022
  • Set permissions for a SharePoint list or library with Power AutomateAugust 3, 2022
  • Handle deleted files in synchronised SP library in Power AutomateJuly 31, 2022
  • Create item with lookup column in a dynamic list (Power Automate)July 27, 2022
  • How to move list between SharePoint tenants with Power AutomateJuly 24, 2022

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

© 2022 Let's POWER Automate | Powered by Superbs Personal Blog theme