web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Issue copying an entir...
Power Automate
Suggested Answer

Issue copying an entire OneDrive folder to SharePoint using Power Automate

(0) ShareShare
ReportReport
Posted on by

Hello,

I’m trying to automate copying a specific folder from my OneDrive for Business to a SharePoint document library using Power Automate.

The folder contains multiple nested subfolders and files, and I want to maintain the exact folder structure.

So far, I’ve tried:

Listing the files in the OneDrive folder
  • Looping through each file to get its content and create the file in SharePoint

  • Creating folders using Create new folder

However, I frequently encounter errors like:

Path for the new folder is not valid

or the files are not placed in the correct subfolders.

I’d like guidance on:

  1. Whether there is a simpler or native way to copy an entire folder, including subfolders, from OneDrive to SharePoint using Power Automate.

  2. How to correctly handle SharePoint paths when using ParentReference.Path or Path.

  3. Best practices to prevent the flow from taking too long when the folder contains many files.

Thanks in advance for any advice or best practices!

Categories:
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    14,418 Super User 2026 Season 1 on at
    When you ask about a simpler or native way, I take that to mean outside of Power Automate. If so, then yes, there is an easier way. Do this:
    1. Go to OneDrive
    2. Choose the folder you want to copy and click on the three dots to the right of the folder name, then choose Copy to from the menu.
    3. Use the quick access section to choose the SharePoint site and then choose the folder under which you want the contents copied to.
    4. Press Copy here to begin the copy.
     
    Although, if I were advising someone where I work, I would suggest that you share the folder with all of the people who have access to the SharePoint site instead. You can share a folder in OneDrive with a group. If there is some reason you don't want to do that, then I would ask why can't you create the files in SharePoint to begin with? It is best to not have copies of files in multiple locations because that breaks the concept of single source of truth.
     
    If you share the folder with the SharePoint group, in the SharePoint site document library, or even the site navigation, you could then add a link to the OneDrive folder on the site.
  • Suggested answer
    Riyaz_riz11 Profile Picture
    4,150 Super User 2026 Season 1 on at
    Hi,
     
    There’s no single native “copy folder with all subfolders from OneDrive to SharePoint” action, so the loop approach is correct, but the paths must be built carefully.
    For each OneDrive item, use its Folder path e.g., /root:/Parent/Sub1/File.txt: and strip the leading part, then append that relative path to the SharePoint library path when creating folders/files.
    When creating folders in SharePoint, ensure the path does not start with a / and that each parent folder exists before creating a child e.g., Library/Sub1/Sub).
    To avoid long runs, process only new/changed files trigger “When a file is created or modified” in OneDrive, or batch the job by top‑level subfolder instead of copying everything in one flow
     
    If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
    Regards,
    Riyaz

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 881

#2
Valantis Profile Picture

Valantis 823

#3
Haque Profile Picture

Haque 485

Last 30 days Overall leaderboard