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

Notifications

Announcements

Community site session details

Community site session details

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

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.

 

Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard