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 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
    Re: How to track the files inside a folder, which gets deleted, when the folder gets deleted - via Power automate

    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

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

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard