cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
tranimal3
Level: Powered On

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
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
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: Powered On

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

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Coming Soon: T-shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

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!

sixthImage

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors
Users online (6,362)