web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Question about creatin...
Power Automate
Answered

Question about creating a flow to copy files from A to B

(2) ShareShare
ReportReport
Posted on by 39
Hello Community,
 
I have a question about my flow. I have a very simple flow that looks like this:
 
 
 
When a file/files are created or edited in location A > a copy is made in location B. 
 
 
The copy folder has a replace function:
 
 
This flow in itself works fine and we've had no issues with it. Where we have had issues is when a file gets deleted in location A, it does not get deleted in location B. I was under the impression that the the 'copy folder' would copy the actual folder with the contents inside and replace the whole folder when the trigger happens. What we are finding however is that files that have been deleted in location A, still show up in location B, which in my mind means the 'Replace folder' is not working correctly? as the folder isn't being 'replaced' but new files are simply being added to location B. Edits etc in location A show up in B so I am a bit confused as to why the deleted files in A are not being deleted in B considering a 'deletion' should count as a 'modification' and therefore activate the trigger?
 
Can someone let me know how to resolve this, please? :)
 
Many thanks,
Katie.
I have the same question (0)
  • Verified answer
    Valantis Profile Picture
    3,470 on at
     
    The issue is with the trigger, not the Copy folder action.
     
    "When a file is created or modified (properties only)" does not fire on deletions. So when a file is deleted in location A, the flow never runs, the Copy folder never executes, and location B keeps the deleted file. This is expected behavior.
     
    To handle deletions you need a second flow:
    1. Trigger: "When a file is deleted" (SharePoint connector)
    2. Action: Delete file in location B using the same file name from the trigger output
    One thing to be aware of: the "When a file is deleted" trigger returns limited metadata (file name, ID, who deleted it) but not the full path. If your folders have subfolders you will need to construct the destination path carefully.
     
    So your full sync solution ends up as two flows:
    - Flow 1 (existing): handles creates and edits via Copy folder
    - Flow 2 (new): handles deletions via the "When a file is deleted" trigger
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

     

  • Verified answer
    MS.Ragavendar Profile Picture
    6,562 Super User 2026 Season 1 on at
     
     
     
    This trigger will capture only the creation of modification event in the sharepoint, if you need to capture the deletion event you need to create a one more flow with when a file is deleted as trigger. 
     
     
    Links
     
    ✅If this helped, please Accept as Solution to help others ❤️ A Like is appreciated 🏷️ Tag @MS.Ragavendar for follow-ups.
  • KatieGrantBAS Profile Picture
    39 on at
    Thank you so much both :) I am glad it is something as simple as that! Appreciate the help!
  • KatieGrantBAS Profile Picture
    39 on at
    just another quick Q on how to do this. On the delete file action for the target location, I don't get the option to narrow down the folders. I can only select the top level/site address for the target site and cannot limit it to the specific folder? I did test this from the 'top' level using the file identifier thinking it might scourer through each level to find the find I wanted to delete but it threw up an error saying it cannot find the file I want to delete.
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 607

#2
Valantis Profile Picture

Valantis 495

#3
Vish WR Profile Picture

Vish WR 429

Last 30 days Overall leaderboard