cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

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

 

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

 

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

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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (10,802)