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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / When a file is deleted...
Power Automate
Unanswered

When a file is deleted in a SharePoint folder, delete file with the same name in a different folder

(0) ShareShare
ReportReport
Posted on by

Greetings all,

 

Is there a way for me to use the "When a file is deleted" trigger to delete a file by the same name in a different location? 

 

The use case is this: 

 

I have a folder on a SharePoint site that holds Excel templates. I already have a flow in place that will duplicate any files placed in that folder to several other children locations (different sites) in their corresponding template folders. What I'd like to do is have automation that does the following: when a file is deleted from the parent template folder, it will also be deleted from all of the children folders such that all of the children remain mirrors of the parent. 

 

The flow works great for copying new files and overwriting changed files to the child folders, but I'm not sure how to setup the deletion of those files when they get deleted from the parent. 

 

Thanks in advance!

Categories:
I have the same question (0)
  • PieterVeenstra Profile Picture
    13 on at

    HI @Anonymous,

     

    Yes, you could build a flow that looks a bit like this:

     

     

    DeleteFile.PNG

  • Community Power Platform Member Profile Picture
    on at

     

    @Pieter_Veenstra wrote:

    HI @Anonymous,

     

    Yes, you could build a flow that looks a bit like this:

     

     

    DeleteFile.PNG


    Thank you for the response! I tried that exact setup but unfortunately it always fails with the following error: 

     

    {
      "error": {
        "code"404,
        "source""flow-apim-msmanaged-na-westus2-01.azure-apim.net",
        "clientRequestId""f128fc37-a7f2-48fc-924d-ec6c1be7ed51",
        "message""The response is not in a JSON format.",
        "innerError""The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."
      }
    }

  • v-bacao-msft Profile Picture
    on at

    Hi @Anonymous,

     

     You could add an action-Get file metadata using path to the Flow, get the File Identifier first, and then delete the file.

    Image reference:

    28.PNG

     

    Best Regards,

    Barry

  • omnagupta Profile Picture
    4 on at

    Can you please explain what would be the file path?

  • Community Power Platform Member Profile Picture
    on at

    Could you please elaborate on this?

  • Dana_L Profile Picture
    10 on at

    Hi Anonymous and others that might have this same issue. Check the post where I shared what worked for me. Hopefully, it will help. 

    SOLVED: When a file is deleted in a SharePoint fol... - Power Platform Community (microsoft.com)

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

Forum hierarchy changes are complete!

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard