cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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
Responsive Resident
Responsive Resident

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.

I am trying to delete them off SharePoint Online

 

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? 


Super User
Super User

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

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 

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
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 (6,365)