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

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Copy folder contents into a new folder

(1) ShareShare
ReportReport
Posted on by 5

I am extremely new to MS Flow and I was wondering if there is a way to copy the contents of a folder into another folder within OneDrive using Microsoft Flow.

 

It seems odd that the functionality is available within the OneDrive GUI, but not within Flow as it seems like they should be able to enable/expose this fairly easy.

 

Sorry if this is a dead horse that's been beat a few too many times...

 

 

 

I have the same question (0)
  • Verified answer
    v-bacao-msft Profile Picture
    on at
    Re: Copy folder contents into a new folder

    Hi @mbrueningESI

     

    Do you want to copy all the files in one folder to another folder?

    I have made a test on my side and the flow works well. Please take a try with the following workaround:

    First use List files in folder to list all the files in this folder, then use Copy file action file to copy to another folder.

    Image reference:

    52.PNG

    I did a test on my side, the subfolders in the folder and the files in it were successfully copied.

    Please take a try.

     

    Best Regards,

    Barry

  • Community Power Platform Member Profile Picture
    on at
    Re: Copy folder contents into a new folder

    Hi all,

     

    I need to do something very similar.  I need to copy a Document Library folder of files from one SharePoint online Document Library to another. 

     

    I have tried the "Copy Folder" Action for SharePoint but keep getting a "Bad Gateway" error for some reason.  Both Document Libraries are on the same site.  One is a Source folder and the other is an Archive folder.  I want to copy all of the Source files to the appropriate Archive folder.  Plain and simple, or so it should be.

     

    I have also tried your method above using the SharePoint  "List Folder" Action where I can point to the correct Source folder, but I can't find an equavelent output from the previous step (you have "value" and all I can use is "body".  Not sure if that is correct.

     

    The last step, "Copy file" in the "Apply to each" section, I can use "Display Name" as a choice.  I'm not sure how to end this flow though.  Everything seems to work until it gets to the Copy file portion.  The flow just sits there waiting for me to hit next and next for each file then at the end it errors with the "Bad Gateway" error again.  The files did actually copy though so that is a very positive point for me.  I just need some help automating this and eliminating the errors.

     

    Any help will be greatly appreciated.  Thanks.

     

    Ed

    Capture.JPG

  • Jessie_Chen_Pru Profile Picture
    6 on at
    Re: Copy folder contents into a new folder

    good morning I came accross this post and woud like to know how I can replicate the flow copy files(new or modified files) from one sharepoint folder to another sharepoint folder. I have tried and look up different posts in the flow communitiy and the posts included the initialize variables, get file properties only  or get file metadata etc more complicated than I expected.  so I am simply looking for setting up a scheduled flow to copy any files(new created/modified) in a sharepoint folder A to a sharepoint folder B.  Thank you

  • Community Power Platform Member Profile Picture
    on at
    Re: Copy folder contents into a new folder

    Hi! Thank you so much for submiting your answer, it really helped. I tried to implement this with sharepoint files and I find myself having to manually cancel the flow because it doesnt stop. It successfully copy the files to the location that I need but the flow doesnt successfuly stop. Will I need to keep canceling it manually after copying the files? I appreciate your help, thank you!

    pvent007_0-1638295445739.png

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 788 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 452 Moderator

#3
developerAJ Profile Picture

developerAJ 302

Last 30 days Overall leaderboard