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 / Move sharepoint files ...
Power Automate
Suggested Answer

Move sharepoint files error "problem deleting folder.Folders that have subsites can't be deleted. "

(0) ShareShare
ReportReport
Posted on by 1,849 Season of Giving Solutions 2025
i am using power automate to get files only from a site then move those files to another site, but on some files i am getting this strange error:-

https://****.sharepoint.com/sites/Operations-Archive/Documents/Information Technology/Board Portal/Board and Committee Portals/Investment Committee Page/Outside Manger Reports/2017*********{"status":400,"message":"There was a problem deleting folder \"/sites/Operations/Shared Documents/Information Technology/Board Portal/Board and Committee Portals/Investment Committee Page/Outside Manger Reports/2017\". Folders that have subsites can't be deleted. CallStack -- at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)\r\n at Microsoft.SharePoint.Library.SPRequest.DeleteUrl(String bstrWebUrl, StorePath bstrItemUrl, DeleteFlags delFlags, String etagMatch, UInt32 dwDeleteOp, Guid& pgOriginatorId, Int32 iThreshold, Int32 iDeletedByUserId, Int64 lDeletedTime, Int32 iAppId, Guid& pgDeleteTransactionId, Int32& piListBaseType, Int32& piListTemplateType)\r\n at Microsoft.SharePoint.SPFolder.DeleteCore(DeleteOp deleteOp, SPFolderDeleteParameters parameters)\r\n at Microsoft.SharePoint.Deployment.SPDeploymentMoveUtil.CleanupFolders(Uri[] exportObjectUris, SPUserToken userToken, DeploymentRealtimeLogger realTimeLogger, Boolean willRetryFromExport, Uri destinationUri)\r\nclientRequestId: fa7f6123-04e8-4f53-8bf0-085905b972da\r\nserviceRequestId: d3b5e1a1-600e-1000-2c1c-2355c5f54ef3"}


the error is saying that it can not delete folders although in my case i am only moving files?? and how can a folder has sub sites?
I have the same question (0)
  • Suggested answer
    MauroBalsano Profile Picture
    6 on at
     
    that error is coming from the Move file action cleanup step.
     
    In SharePoint a "move" is effectively the sum two distinct actions: copy and delete, and Power Automate also tries to delete the source folder when it thinks it became empty.
    If that folder still contains anything, like i.e. hidden or system files, subfolders, or leftover items from parallel runs, SharePoint returns: "Folders that have subsites can't be deleted": here "subsites" just means subfolders, not actual SharePoint sites.

    So, like workarounds: use Copy file and then Delete file instead of Move, so no folder cleanup is attempted, or move only the file path and keep the source folder in place.
     
    Also check you're not running moves in parallel on the same folder, because that often leaves subfolders/items behind and triggers this.
     
    Let us know if it works.
  • johnjohnPter Profile Picture
    1,849 Season of Giving Solutions 2025 on at
    @MauroBalsano But in my case i do not have parallel move operations, also since i only move files, i can see many empty folders been left inside the source library and did not raise errors. so i do not think moving a file will also remove the parent folder if it is empty.

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard