Forum Discussion

mohamadmomo's avatar
mohamadmomo
Copper Contributor
Nov 27, 2024
Solved

adding an AAD security group to site collection administrator using power automate

so im trying to do what the title says but i keep getting the error from the flow that the group cannot be found although it exists and i can find it connected to the sharepoint site here is the http...
  • mohamadmomo's avatar
    Dec 02, 2024

    hi , thank you for your answer, yes this format worked at the end but you can add them in one HTTP request no need for 2:

    {

      "type": "OpenApiConnection",

      "inputs": {

        "parameters": {

          "dataset": "https://.sharepoint.com/",

          "parameters/method": "POST",

          "parameters/uri": "_api/web/siteusers",

          "parameters/headers": {

            "content-type": "application/json;odata=nometadata",

            "accept": "application/json;odata=nometadata"

          },

          "parameters/body": "{\n    \"LoginName\": \"c:0t.c|tenant|a1e0c1af-...\",\n    \"IsSiteAdmin\": true\n}"

        },

        "host": {

          "apiId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline",

          "connection": "shared_sharepointonline",

          "operationId": "HttpRequest"

        }

      },

      "runAfter": {

        "Compose": [

          "Succeeded"

        ]

      }

    }

Resources