web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Using Power Automate f...
Power Automate
Answered

Using Power Automate flow to delete all files and folders inside a sharepoint folder

(1) ShareShare
ReportReport
Posted on by 11

Hi all,

I've followed the steps in there to automate file deletion based on the creation dates.

Delete files from a sharepoint folder - Power Platform Community (microsoft.com)

However, folders are not getting deleted, If I dump all the files in one folder, and rerun the flow, all files get deleted without any issues.

That is the error "TobeDeleted/24-001 does not exist" I get which relates to one of the folders inside the main folder.

Any suggestions are welcome.

 

Thank you.

 

2.PNG
flow_delete files.PNG
1.PNG
Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @jebz ,

     

    To delete all contents from a folder, you can use the Delete item action. It's not supported to delete folders using Delete file action.

    vjefferni_0-1710234090592.png

     

    In Delete item action, you need to retrieve list name from Peek code in Get files action, copy table id and paste in the List name field in Delete item action:

    vjefferni_1-1710234443708.png

    vjefferni_2-1710234502021.png

    vjefferni_4-1710234565177.png

     

    Note that in Get file action, Include Nested Items needs to be false and in Delete file action it needs to use ID instead of Identifier.

     

    Best regards,

  • Verified answer
    jebz Profile Picture
    11 on at

    That worked perfectly, thank you so much.

  • CU03091917-0 Profile Picture
    26 on at
    Still fails
     
    You have to delete all the items in this folder before you can delete the folder.
    clientRequestId: c03de77e-a9da-427d-806e-
    serviceRequestId: 21bb4ca1-f065-6000-6667-

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 283

#2
David_MA Profile Picture

David_MA 256 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard