cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FredCamoai
Regular Visitor

Create SharePoint group with a specific owner

Hello,

 

When I create a group by specifying the OwnerTitle, it is not taken into account. I do not understand why. Would you have a solution please?

 

My JSON : 

{
    "inputs": {
        "host": {
            "connection": {
                "name": "@parameters('$connections')['shared_sharepointonline_2']['connectionId']"
            }
        },
        "method": "post",
        "body": {
            "method": "POST",
            "uri": "_api/web/sitegroups",
            "headers": {
                "accept": "application/json;odata=verbose",
                "content-type": "application/json;odata=verbose"
            },
            "body": "{ '__metadata': { 'type': 'SP.Group' }, 'Title': '@{variables('grCollab')}', 'OwnerTitle': '@{body('Mettre_à_jour_l''élément')?['Responsable_x0020_client']?['Claims']}'}"
        },
        "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('SiteUrl')))}/httprequest",
        "authentication": "@parameters('$authentication')"
    },
    "metadata": {
        "flowSystemMetadata": {
            "swaggerOperationId": "HttpRequest"
        }
    }
}

The body : 

 '__metadata': { 'type': 'SP.Group' }, 'Title': 'Test Collabs 3 - Collaborateurs', 'OwnerTitle': 'i:0#.f|membership|testdv@xxxxxxxxxxxxxxx.xxx'}

The output : 

{
  "d": {
    "__metadata": {
      "id": "https://xxxxxxxxxxx.sharepoint.com/sites/Projects/_api/Web/SiteGroups/GetById(67)",
      "uri": "https://xxxxxxxxxxx.sharepoint.com/sites/Projects/_api/Web/SiteGroups/GetById(67)",
      "type": "SP.Group"
    },
    "Owner": {
      "__deferred": {
        "uri": "https://xxxxxxxxxxx.sharepoint.com/sites/Projects/_api/Web/SiteGroups/GetById(67)/Owner"
      }
    },
    "Users": {
      "__deferred": {
        "uri": "https://xxxxxxxxxxx.sharepoint.com/sites/Projects/_api/Web/SiteGroups/GetById(67)/Users"
      }
    },
    "Id": 67,
    "IsHiddenInUI": false,
    "LoginName": "Test FDE Collabs 3 - Collaborateurs",
    "Title": "Test FDE Collabs 3 - Collaborateurs",
    "PrincipalType": 8,
    "AllowMembersEditMembership": false,
    "AllowRequestToJoinLeave": false,
    "AutoAcceptRequestToJoinLeave": false,
    "Description": null,
    "OnlyAllowMembersViewMembership": true,
    "OwnerTitle": "TATA",
    "RequestToJoinLeaveEmailSetting": null
  }
}

Thanks for your help and sorry for my english 😉

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Create SharePoint group with a specific owner

HI @FredCamoai ,

 

It seems that you would like to create a SharePoint group with a specific owner.

 

I have seen the following threads for your reference:

https://social.technet.microsoft.com/Forums/en-US/2dcf6e49-cff8-403b-b52e-04d240bef16d/set-group-own...

https://sharepoint.stackexchange.com/questions/198710/changing-the-owner-of-a-group-via-rest-api

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Create SharePoint group with a specific owner

HI @FredCamoai ,

 

It seems that you would like to create a SharePoint group with a specific owner.

 

I have seen the following threads for your reference:

https://social.technet.microsoft.com/Forums/en-US/2dcf6e49-cff8-403b-b52e-04d240bef16d/set-group-own...

https://sharepoint.stackexchange.com/questions/198710/changing-the-owner-of-a-group-via-rest-api

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

pennyland Helper II
Helper II

Re: Create SharePoint group with a specific owner

I too am trying to do this, but i keep getting the following error:

{
"status": 400,
"message": "An entry without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified.\r\nclientRequestId: f1578e3e-011b-437f-aaaf-552b6c1d9271\r\nserviceRequestId: 5d303f9f-604a-b000-122c-a2b4f8d6777c",
"errors": [
"-1",
"Microsoft.SharePoint.Client.InvalidClientQueryException"
]
}
 
I don't see any typos.  But there must be one or I'm missing something. 
 
flow_failing_group_creation.PNG

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (7,020)