Hello! I have gone through a past thread about deleting folders from a library and tried all the options presented.
None of them work.
I have:
It fails with a 400 status and tells me two fields (which are NOT part of the library that I can see) are not installed properly:
clientRequestID: GUID
serviceRequestID: GUID
I can't get my screen shot to load so I apologize for no images.
Is something missing or are there any other options to use to delete a folder?
@NoName404's and @v-liwei-msft's answer still works . . . @CU03091917-0, you might have something wrong with your parameters in the "HTTP Request to SharePoint" As long as you specify "/sites/SiteName/FolderPath/FolderName" to the _api string inside the parentheses, it should work.
Thanks mate!
Don't know why this is marked as the solution is it will 100% not work. It doesn't even match MS's own (not working) documentation. According to MS no path should be required.
https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest#working-with-folders-by-using-rest
Anyway this should be simple but for whatever reason this is another thing in the endless list of things with powerautomate that take forever to figure out because of a lack of quality.
Edit: In case anybody comes across this and has wasted two hours trying to figure out what the correct path is, this should work.
_api/web/GetFolderByServerRelativeUrl('YourLibraryName/YourFolderName')
Hi @Anonymous Delete Item works. - You followed the right steps, just put Documents in List item and item Id from get metadata into the Id. It will work.
I have tried the same, working for me. Thanks
Thank you sooooooo much😍 @v-liwei-msft , @Anonymous
it's working
Thank you! That worked perfectly!
Hi @Anonymous
Flow does not provide an action to delete folders directly.
You can delete folders using Send an HTTP request to SharePoint.
I made a test for your reference:
_api/web/GetFolderByServerRelativeUrl(‘/sites/YourSiteName/YourDocumentLibraryName/FolderName‘)
I think this link will help you a lot:
Best Regards,
Levi
ankit_singhal
5
Super User 2025 Season 1
Michael E. Gernaey
4
Super User 2025 Season 1
David_MA
2
Super User 2025 Season 1