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 / Copy all folders and f...
Power Automate
Answered

Copy all folders and files from one document library to another library

(1) ShareShare
ReportReport
Posted on by 70
Dear all,
I have a requirement to copy all folders and files from one document library to another library in another site collection using Power Automation Flow.
This is to be done only one time by manually triggering the flow. Please share the ideas how I can acheive this. Thank you for your help and support.
Categories:
I have the same question (0)
  • Verified answer
    narayanareddy_g Profile Picture
    70 on at
    I can use this link to achieve this but I added the below steps to achieve this.
     
    1. Get Files from the Source Site. Also choose Yes for Include Nested Items.
        
    2. Use Parse JSON
    3. In the Apply To Each
        a. Get Identifier with Compose
        b. Get IsFoloder with Compose
        c.  Get Path with Compose
        d. Get Length Path as mentioned in the above link 
        e. Now, check if it is in the root folder by checking the length is equal to 2
        f. if it is true then use copy folder action to copy the folder as shown below. Use a. Identifier in the Folder to copy
          
      g. if it is false then use copy file action to copy the file as shown below. Use a. Idenftifer in the File to Copy
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at
    Hi. Try like this
     
    1. Get all files and folders from specific document library
     
    2. Loop through each of it using apply to each
     
     
    Inside apply to each, do the following
     
    2.1- Try to check whether file/folder with same id exists before moving as shown below
     
    2.2- use condition to check the same 
    Expression - 
    length(outputs('Get_files_(properties_only)_2')?['body/value'])
     
    If the condition is true, file exist there so proceed to yes branch 
     
    Use condition to check whether object to be moved is a file/folder like above
     
    if yes, then use move folder to move that folder like below
     
     
    if no, use move file to move the folder
     
     
    Try this approach
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!

     
     
  • Suggested answer
    CU06081612-3 Profile Picture
    on at
    In order to return, please create a refund/return request or request a call back from our support/team (75012-14159. ) on CITY.mall mobile application within the time period/  How do I return a product on the CityMall app?

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 816

#2
Valantis Profile Picture

Valantis 603

#3
Haque Profile Picture

Haque 566

Last 30 days Overall leaderboard