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