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 / How to track the files...
Power Automate
Unanswered

How to track the files inside a folder, which gets deleted, when the folder gets deleted - via Power automate

(0) ShareShare
ReportReport
Posted on by

Hello All,

 

I have a scenario and looking for a optimum solution for the below case.

 

Currently, i have a folder "Test Folder1" inside a SharePoint document library, this particular folder has several files and subfolders inside it.

 

Example:

TestFolder1

  1. File1.docx

  2. File2.xlsx

  3. Test SubFolder1

    1. FileX.pdf

    2. FileY.txt

 

Currently we have "When a file is deleted" trigger on Power automate for SharePoint, which when triggered gives only the Folder level information like below - {"ID":1,"Name":"TestFolder1","FileNameWithExtension":"TestFolder1","DeletedByUserName":"Niladrish Mohapatra","TimeDeleted":"2024-02-19T13:18:05Z","IsFolder":true}

 

when the folder is deleted, but no information about the inside subfolder/files. I want to track which all sub folder or files are getting deleted, also due to the folder deletion.

 

In actual business scenario, there are hundreds of folders and thousands of files inside them, so looking for a better optimum solution for this case.

 

Thanks in advance, happy to provide further info, if needed!

 

Best Regards,

Niladrish Mohapatra

Categories:
I have the same question (1)
  • Unknown geen idee Profile Picture
    1,757 on at

    Dear N,

     

    Interesting question to which I would think that a full IT back-up policy would likely be more suited. Suggest that you first figure out if IT does not have the data/back up that you are looking for. 

     

    If you really need/want to do this via PowerAutomate, suggest that you build a completely seperate flow which the sole purpose to track all the folders/file in a certain domain. This flow will run on a scheduled time. Depending on the period (1min, 5min, 1 day, 4 days ...) you will have a 'up-to-date' situation.

    The flow builds up a 'masterfile' with the folder and files details including status.

    The flow should run something like this:

    • Scheduled trigger.
    • Create a run-ID
    • List files in folder (starting folder)
    • Save output in masterfile (with run-ID).
    • For all the folder found (IsFolder element).
      • List files in folder (starting folder)
      • Save output in masterfile (with run-ID).
      • For all the folder found (IsFolder element).
        • List files in folder (starting folder)
        • Save output in masterfile (with run-ID).
      • etc. etc.
    • For all the files in the masterfile which do not have the same run-ID, change status from active to non-active.

    Something like that, hope you get the idea.

    Happy flowing,

    Koen

     

     

     

     

     

     

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 286

#2
David_MA Profile Picture

David_MA 256 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard