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

Notifications

Announcements

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,129 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard