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

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
Community Support

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
Community Support

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

Highlighted
New Member

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

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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