cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mbrueningESI
Level: Powered On

Copy folder contents into a new folder

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

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

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 Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

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 Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

emegrant
Level: Powered On

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
Level: Powered On

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

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (6,436)