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 / Sync a SharePoint/Team...
Power Automate
Answered

Sync a SharePoint/Teams folder across multiple SharePoint/Teams - Copy new files, updates existing and removes deleted files

(0) ShareShare
ReportReport
Posted on by

Anyone built a flow that will allow me to sync content from a "master source" folder to other folders in other SharePoint/Teams - Sync Folder 1, Sync Folder 2 etc? 

 

I've got a flow that successfully copies the folder and adds new items or overwrites existing items but doesn't delete items that I have removed from the "master source" folder.

 

I though about adding a step prior to the copy that would move the various "Sync Folder" into the site recycle bin first then copy the master source in its entirety i.e. wipe the slate clean and copy the latest folder completely but I'm sure there must be a more elegant way.

Categories:
I have the same question (0)
  • Verified answer
    v-litu-msft Profile Picture
    on at

    Hi @Anonymous,

     

    Before copy "master source" folder delete all files in "Sync folder" is the most effective way.

    The elegant way is after copy files from "master source" to "Sync folder" use Flag to mark these files in sync folder whether exist in the source folder. Create a two-level loop through all files in the "Sync folder" and "master source", comparing file name with extension to find the file whether exist in the source folder. If find it, set Flag to 1, means this file still exist in master source, after loop through "master source", if the Flag still 0, delete the file in "Sync folder". The most import is to set the flag to 0 after the condition.

    For example:

    Annotation 2020-06-09 131131.jpg

     

    Annotation 2020-06-09 131201.jpg

     

    Annotation 2020-06-09 131223.jpg

     

    Annotation 2020-06-09 131243.jpg

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard