cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tranimal3
Level: Power Up

Delete file older than 90 days from Subfolder in Sharepoint

Hello new to Flow.

 

I've researched through this community and tried various methods but still cannot get files to delete from a subfolder within SharePoint.  I have tried to just go get the files and display in a table to see if it's even grabbing the right files and have been unsuccessful.  The last attempt has been to just delete all files within a subfolder which I was still unable to successfully complete.

 

I would like to delete files older than 90 days but for now I think being successful at using flow to just delete files from a folder is a good start.   

 

As you'll see from my screenshot, the files I want to delete are not on the main parent folder but within a few layers: 

 

  • Documents/Testing Channel/Email Messages/

 

This is a screenshot of my flow for deleting all files within the subfolder.  The flow completes successfully but nothing is deleted.

 

2020-01-22_13-10-47.jpg

 
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: Delete file older than 90 days from Subfolder in Sharepoint

 

Hi @tranimal3 ,

 

You can try to use List folder action to get all files in the specified folder, and then use Delete file to delete all files in the folder.

This action can only get the files in the specified folder, but it cannot get the files in the subfolders contained in this folder.

I have tested it on my side and it can delete all files in the folder.

Image reference:

58.PNG

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support Team
Community Support Team

Re: Delete file older than 90 days from Subfolder in Sharepoint

 

Hi @tranimal3 ,

 

You can try to use List folder action to get all files in the specified folder, and then use Delete file to delete all files in the folder.

This action can only get the files in the specified folder, but it cannot get the files in the subfolders contained in this folder.

I have tested it on my side and it can delete all files in the folder.

Image reference:

58.PNG

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

tranimal3
Level: Power Up

Re: Delete file older than 90 days from Subfolder in Sharepoint

Perfect!  Thanks @v-bacao-msft for the help.  I was able to delete the files.  

 

I also added a condition in to delete the files older than 90 days.  

 

Thanks again!

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

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!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (4,514)