cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
scottlayton
Frequent Visitor

Sharepoint copy files and folders to new location (with same folders)

Hi, 

 

New here and need some help! 

I am trying to create automation for file and folder copying between sharepoint sites. 

 

We have a team where our content creators make and manage content. They put all of the final documentation in the following:

(SOURCE SITE) business.sharepont.com/site/contentmakers/Shared Documents/Product Information/...

 

The goal is to create an automation that copies all folders and files to other sites to keep teams seperated but all content up to date. 

(DESTINATION SITE) business.sharepoint.com/site/usersofcontent/shared documents/product Info/...

 

I am able to get a copy and delete flow working on the product info folders; e.g. when we upload to source site it is copied into destination site. Likewise when we delete from the source site it is deleted from the destination site. 

 

The problem is when we past a folder of contents into the source site, the flow doesn't copy the folder and it's contents (assorted file types) into the destination site. 

 

e.g (SOURCE SITE)/test folder/test.pdf doesn't copy to (DESTINATION SITE)/test folder/test.pdf

 

How can I get this working? 

 

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User
Super User

Hello @scottlayton ,

I wrote two blog post on working with folder that you might find helpful. One is a one time copy including the folder structure, the other is to keep the libraries synchronised, including the folders.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

4 REPLIES 4
tom_riha
Super User
Super User

Hello @scottlayton ,

I wrote two blog post on working with folder that you might find helpful. One is a one time copy including the folder structure, the other is to keep the libraries synchronised, including the folders.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

@tom_riha This is great thank you! Will try this now. 

 

Will the synchronisation also delete files and folders if they are removed from the source site? 

 

My only other question is, if a change is made at the destination side, will this reflect back to the source site. We are trying to avoid this where possible. 

Hello @scottlayton ,

It'll not delete files nor folders, the trigger is on 'Create or modify...'. For deletion you'll need a separate flow started with the 'When a file is deleted' trigger, search for the file using 'Get files (properties only)' filtering by the original file name, and then delete it. Trigger, Get files, Apply to each, Delete file - 4 actions in total.

FileLeafRef eq '@{triggerOutputs()?['body/FileNameWithExtension']}'

image.png

The synchronisation is only a one-way synchronisation, from library A to library B. 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]
scottlayton
Frequent Visitor

Thank you @tom_riha 

 

Everything is working as planned. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (2,567)