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

Deleting Sub Folders

Hi,

 

I am trying to create a flow where I can delete a large number of subfolders within a folder. I want to keep the master folder but need to get rid of all its contents. This action will need to be completed once a year. Does anyone have any ideas or solutions?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Deleting Sub Folders

My list is also a document library. Just type in the document library name as a custom value and it will find it with no problem.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

View solution in original post

6 REPLIES 6
Highlighted
Resolver III
Resolver III

Re: Deleting Sub Folders

Where are you deleting the folders from?

One Drive, SharePoint, A File Share, Your local computer? 

This sounds more like a PowerShell thing than a Flow thing. Just my 2 Cents.

Highlighted
Regular Visitor

Re: Deleting Sub Folders

I am trying to delete them off SharePoint Online

 

Highlighted
Resolver III
Resolver III

Re: Deleting Sub Folders

Okay, last question.

You said 


@Brycekauffman wrote:

 I want to keep the master folder but need to get rid of all its contents.

 


Does that mean, any files and folders in the root directory as well? 


Highlighted
Super User III
Super User III

Re: Deleting Sub Folders

HI @Brycekauffman, you can do this using the image below. So in this example I have a master folder called Accreditation and then a subfolder called New with a lot of subfolders in it. You can delete New and all the sub folders in it - but not the main Accreditation folder - by:

  1. Add an action for Get folder metadata by path. It uses the folder path of /Accreditation/New.
  2. Add a Delete item action using the list name Accreditation and the Id is the Get folder metadata ItemId from the dynamic content.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

0-DeleteFolders.png

Highlighted
Regular Visitor

Re: Deleting Sub Folders

It looks like my folders are set up in a document libreary and not a list. There for in the Delete Item flow it is not recongizing my folder structure in the "list name" section. What would be a good substitute? @RobElliott 

Highlighted
Super User III
Super User III

Re: Deleting Sub Folders

My list is also a document library. Just type in the document library name as a custom value and it will find it with no problem.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

View solution in original post

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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
Users online (7,425)