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 : pRyNbB8+J/iW7gYw2iUK1j
Power Automate - Building Flows
Answered

Synch one SharePoint folder to another SharePoint folder daily

Like (1) ShareShare
ReportReport
Posted on 31 Mar 2020 20:31:20 by 6

This is what I’m trying to achieve:

 

I have a teams group, called Student Government, and one of the private channels is named Senate. I will be adding documents into the Senate Documents Folder every week. I want the Senate channel to be private, but there are files in the Senate Documents Folder that are public and I would like to go in the General Documents Folder. I would like to create a Power Flow that syncs the Senate Documents Folder to the General Documents Folder daily, so that way I don’t need to upload the same documents to both folders every time I make a change.

 

I have been experiencing with the templates, and have came across the template: Copy files from one SharePoint Online account or folder to another. This works when I upload files directly to the Senate Documents Folder, But if I add a new folder in the Senate Documents Folder and add documents to that, it will not sync that nested folder or documents to the General Documents Folder. Also, if I edit the document in the Senate Documents Folder or delete it, that change will not reflect in the General Documents Folder.  Here is an image link to my flow settings: https://drive.google.com/file/d/16nZthLtyEELOTbnFdF51YvF-xAoBka7b/view?usp=sharing

 

These folders in the Senate Documents Folder Have files in them but these folders and their files do not sync to the General Documents Folder. Here is an image link to what my Senate Documents Folder looks like: https://drive.google.com/file/d/1hJAy5ZFV2NSo3g__DEEawEch1vTMjxSz/view?usp=sharing

 

Here is an image link to what my General Documents Folder looks like: https://drive.google.com/file/d/1hJAy5ZFV2NSo3g__DEEawEch1vTMjxSz/view?usp=sharing

 

Would appreciate any assistance!

I have the same question (0)
  • Verified answer
    v-litu-msft Profile Picture
    on 02 Apr 2020 at 10:16:06
    Re: Synch one SharePoint folder to another SharePoint folder daily

    Hi @lindsaln,

     

    Sorry, if it is an item of SharePoint list, it could get the previous version, but the file couldn't.

    As a workaround, you could create a custom column at both sides of SharePoint list if exist the situation that filename will be modified, when a file modified in a list, modified the file in the other list according to the column value.

     

    And my apologies, when a file is deleted seems not to work through my previous reply. You could create a Flow with trigger when a file is deleted, loop through the ID of the file list in A library, and then loop through B library to find the file exists in B library but not exists in A library, and then delete it.

     

    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.

  • lindsaln Profile Picture
    6 on 02 Apr 2020 at 01:51:21
    Re: Synch one SharePoint folder to another SharePoint folder daily

    Hi @v-litu-msft ,

     

    Thank you for taking the time to respond! I have implemented your suggestion and it works when adding a new file. I am now running troubles when modifying an existing file. The problem that I am running into is when renaming a file in my original folder path.

     

    For example, I have Book1.xls file in /Shared Documents/Senate/, which is also in my destination folder /Shared Documents/General because of the first flow. When I rename that file to Book2.xls, my current flow will add that to the destination folder /Shared Documents/General, but the old filer Book1.xls will still linger. Is it possible in the flow to have the data of the file before it was modified? For example is there a variable or output to get that Book1.xls data when this flow is triggered?

     

    Here is a screenshot of my current flow setup, i just need to determine the File Identifier (aka the Book1.xls file that needs to be deleted since Book2.xls is being added): https://drive.google.com/file/d/1q_Uxqkvm2ApR4WtDi_gG4eTxHnlJQ-c-/view?usp=sharing

     

    Thank you for your assistance!

     

    Logan

  • v-litu-msft Profile Picture
    on 01 Apr 2020 at 08:25:38
    Re: Synch one SharePoint folder to another SharePoint folder daily

    Hi @lindsaln,

     

    You could following these steps to create a file when it is created in a folder:

    1. When a file is created (properties only), replace the original folder path to the destination folder path, for example:

    replace(triggerBody()?['{Path}'],'Hub/Car','Hub/Cases')

    2. Get the file content by using path;

    3. Create a file in the destination folder by using folder path got from step 1.

    Annotation 2020-04-01 161739.png

    After that, the folder also would be sync to the destination folder.

     

    The rest can be done in the same manner is that you could create two flow to sync the edited file and deleted file.

     

    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

Responsible AI policies

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

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 736 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 396 Moderator

#3
Power Apps 1919 Profile Picture

Power Apps 1919 339

Last 30 days Overall leaderboard
Loading complete