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 / Search and delete with...
Power Automate
Unanswered

Search and delete within sub folders for 100+ files

(0) ShareShare
ReportReport
Posted on by 4

Hello,

 

I am trying to find a way to search for files and delete them along a path that has several folders and subfolders. 

 

Consider the following folder structure:

Root\Test\Read\User1, User2, User3, etc\subfolders\more subfolders

 

I have tried two methods to achieve this:  List Files in OneDrive Business and Search for files using path OneDrive for Business.  The list option does not recourse beyond the first folder and the search option works but has a limit of 100 results (I suspect that there will be more than 100 files once the project has started).

 

I would like to delete any file that is found that is more than 30 days old and whose  name does not start with "archive_".  Before the file is deleted, I would like to append a text log with the date and file path.

 

I got all of these parts to work as long as there are not too many subfolders or the search result returns less than 100 results.  I would appreciate any help on how to overcome these limitations.

 

Thank You,

Gary

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @Gary111 :

    I suggest creating a do until loop until all eligible files are deleted:

    vbofengmsft_0-1632289827838.png

    vbofengmsft_1-1632289844228.png

    Best Regards,

    Bof

     

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