cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Delete files in batches in a OneDrive for Business folder

I would like to delete all files in a particular OneDrive for Business folder. I cannot do it normally because the number of files there is larger than some hidden limit and I am getting error 36. I can delete them one by one or in small batches that this will take forever. So, I would like to try a flow that would delete all those files for me one by one or in reasonably batches (100 at a time?), possibly waiting between deletions not to overwhelm the system. I suspect that listing all files in one go would also result in errors, so maybe the actions should be:

 

  1. List first 100 files in the given directory.
  2. Delete these files.
  3. Wait till completed.
  4. Repeat.
  5. Report when no files are found.

I am completely new to Flow so would really appreciate a recipe.

 

Thank you.

2 REPLIES 2
Highlighted
New Member

Re: Delete files in batches in a OneDrive for Business folder

Here is my naive go. This fails with Bad Gateway message, status code 504. Maybe because of too many files for the search?

 

2019-01-06-19-55-59

 

 

 

Highlighted
Community Support
Community Support

Re: Delete files in batches in a OneDrive for Business folder

Hi @___,

 

Could you please share the screenshot and more details about the error message when the flow run failed?

 

Best regards,

Alice

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (8,831)