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

Sync libraries "When an item or file is modified" - search and replace in subfolders

Like (0) ShareShare
ReportReport
Posted on 30 Dec 2020 15:14:26 by 10

Hi All,

I am trying to build a flow (as you can probably guess):

- Library 1: Master files, in subfolders, modified every once in a while.

- Library 2: Same files, but different folder structure with subfolders and sometimes multiple duplications of the files.

Library 1: When a file is updated, I want it to search through Library 2 and all subfolders and replace the file and all dublications of it with the new version.

 

I of course started with the easy one, it copies all updates to the destination folder. But I want it to search through the subfolders of the destination folder and replace it there. Is that at all possible? Any ideas would be very much appreciated 🙂

 

Thank you!

 

File flow.JPG

 

 

I have the same question (0)
  • Annnika Profile Picture
    10 on 01 Jan 2021 at 11:55:37
    Re: Sync libraries "When an item or file is modified" - search and replace in subfolders

    Hello Sudharsan,

     

    thank you! Unfortunately not, the copying works perfectly, but the challenge is that it should not simply copy the file to a certain main destination folder in library 2, but search through library 2 and all it's subfolders to find and replace the file wherever it can be found.

     

    Best regards

    Annika

  • sudharsan1985 Profile Picture
    1,325 on 01 Jan 2021 at 02:59:25
    Re: Sync libraries "When an item or file is modified" - search and replace in subfolders

    Hi @Annnika 

    Please refer to the below link

    Power Automate – How to auto copy or move files in SharePoint Library | Knowledge Share (spknowledge.com)

     

  • Annnika Profile Picture
    10 on 31 Dec 2020 at 15:36:42
    Re: Sync libraries "When an item or file is modified" - search and replace in subfolders

    Thank you for the response!

    I have set it up accordingly, but struggle a bit with the "copy file". So in the first steps it takes all information from library 1, but in "copy file" there is no mention of library 2 as destination folder to search through. What am I missing here?

     

    Best regards

    Annika

  • v-litu-msft Profile Picture
    on 31 Dec 2020 at 09:54:22
    Re: Sync libraries "When an item or file is modified" - search and replace in subfolders

    Hi @Annnika,

     

    You could following these steps to approach that:

    substring(outputs('Get_file_properties')?['body/{Path}'],0,lastIndexOf(outputs('Get_file_properties')?['body/{Path}'],'/'))

    Screenshot 2020-12-31 175314.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

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

#2
Tomac Profile Picture

Tomac 650 Moderator

#3
trice602 Profile Picture

trice602 327 Super User 2025 Season 2

Last 30 days Overall leaderboard