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 :
Power Automate - Building Flows
Unanswered

Sharepoint to Sharepoint library's files copied. How do i keep it all in sync?

(0) ShareShare
ReportReport
Posted on by 16

Hi All,
I am new to power automate 🙂


I have on an existing power automate flow two SharePoint document library’s that are identical but found in different places. One is named STEW 1 and the other STEW 2. Once every day at 10:00 pm the flow copies all the files and folder contents across from STEW 1 to STEW 2. Then replaces them all again the day after and so on.
I want to add to this flow the steps to update any modified content to files in STEW 1 and copy these and any new files created to STEW 2 when the flow runs again, anything untouched and not changed can stay the same. I will work from STEW 1 and for anything I do I want to mirror across to STEW 2. is this possible? I would appreciate any help beforehand.

Thank you.

 

Stew.

I have the same question (0)
  • Unknown geen idee Profile Picture
    1,757 on at
    Re: Sharepoint to Sharepoint library's files copied. How do i keep it all in sync?

    Dear G,

     

    Please find below example on how you could filter out the files based on a 'LastModified'.

    'LastModified' is a standard output as part of the 'List Folder' action (and various other actions), this is basically one of the file characteristics which the action retrieves.

     

    As a result, the output from the 'Filter Array' is a selection of files which have been modified after a certain date.

    The expression which you can use as a limit is: "addDays(utcNow(),-1)"

    utcNow is an expression for the current date/time, addDays() is a function which we use to change the date ... in this case the result is 'now minus 1 day'.

     

    Suggest you play around with this a bit.

    Happy flowing,

    Koen

     

    Koen5_0-1682405684622.png

     

  • gl5150 Profile Picture
    16 on at
    Re: Sharepoint to Sharepoint library's files copied. How do i keep it all in sync?

    Hi Koen5,

     

    Thank you so much for your reply. Power automate is fantastic and I am really enjoying learning about it.

     

    The filter array returns the correct information to the output for BODY.

    I have tried to intergrate your solution into my copy flow and it does not work. If I change VALUE to BODY I get an error.

    Source file not set
    clientRequestId: de8bc6ac-6048-416c-90d8-314ab0de2cda
    serviceRequestId: de8bc6ac-6048-416c-90d8-314ab0de2cda

     

    What do you think? 😉 sorry if I am a NOOB....

    Screenshot 2023-04-25 223619.png

  • Unknown geen idee Profile Picture
    1,757 on at
    Re: Sharepoint to Sharepoint library's files copied. How do i keep it all in sync?

    Dear G,

     

    I suspect that you are mixing some outputs somewhere ... but I cannot tell from the screenshot.

    Suggest that you make some changes:

    • Remove the 'Get Files' ... it does not seem to serve any purpose in this flow. As such it can only confuse elements to pick from.
    • Ensure that your 'Apply to each' is based on the output from the 'Filter Array'. It seems that you have chosen the output from another action (but I cannot be sure).

    For the rest, your actions/sequence (if you make the suggested changes) seem ok and you should be able to make this work. Keep trying!

     

    Happy flowing,

    Koen

     

     

     

  • gl5150 Profile Picture
    16 on at
    Re: Sharepoint to Sharepoint library's files copied. How do i keep it all in sync?

    Hi Koen,


    Please see what I am using to copy files across below. Had a good session yesterday but can not get it to work correctly. I removed the GET FILES, used BODY from the FILTER ARRAY and I could only get it to copy the folders but not the files. I believe I am nearly there lol. I will keep trying 😉 but I think I have hit a wall. Thanks for your responses. 

    Stew

     

    IMG_1270.jpeg

    IMG_1269.jpeg

  • Unknown geen idee Profile Picture
    1,757 on at
    Re: Sharepoint to Sharepoint library's files copied. How do i keep it all in sync?

    Dear G,

    Instead of using 'Get Files (properties only)', use 'Get Files'. I believe this should solve your problem of not being able to copy files.

    If that fails ... get the files content first with a 'Get content' action, with that you can for sure copy the files.

     

    Take note that you may have to change some references in the 'Copy file' action as a result.

     

    Happy flowing,

    Koen

  • gl5150 Profile Picture
    16 on at
    Re: Sharepoint to Sharepoint library's files copied. How do i keep it all in sync?

    Hi Koen5,


    Sorry I wasn’t clear above and appreciate your patience 😉. The last screen shots i posted works but copy’s all the files and folders, every time I run the flow. I just want it to copy last modified files and add any new files, folders since the last flow was run. How do I integrate your suggestion it to the above please. Many thanks 🙏 

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

Coming soon: forum hierarchy changes

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
Tomac Profile Picture

Tomac 532 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 461 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 256

Last 30 days Overall leaderboard