PowerAutomate SharePoint Server relative urls must start with SPWeb.ServerRelativeUrl

{
    "inputs": {
        "variables": [
            {
                "name": "varURI-String",
                "type": "string",
                "value": "/_api/web/GetFolderByServerRelativeUrl('@{triggerBody()?['FolderPath']}')/ListItemAllFields/breakroleinheritance(copyRoleAssignments=false, clearSubscopes=true)"
            }
        ]
    }
}

Using a Power Automate Flow to break inheritance on a folder and this error was being returned. The issue turned out to be the path I was trying to use for the folder.

This did not work: LibraryName/Folder
This DID work: /sites/ParentSite/SubSite/LibraryName/Folder’

2 thoughts on “PowerAutomate SharePoint Server relative urls must start with SPWeb.ServerRelativeUrl

  1. I had a similar situation where I had to break inheritance on specific subfolders. I never imagined that the process of breaking inheritance on subfolders inside a document library would be so different than breaking inheritance on the document library itself.

    It took me about 3 days of unsuccessful trial and error, until I copied that same error message into my browser, which led me to here. After I added the full path into my workflow, it finally worked. You’re a lifesaver.

Leave a Reply

Your email address will not be published. Required fields are marked *