Hi,
I'm trying to set a flow that will create a hubsite, after the site is created, it will add a specific 365 group to the site a visitor, this group contains all our employees and gives them visitor access to every hubsite that is created (we are creating a hubsite per client and need all employee's to have access).
I have the flow working with all aspects apart from being able to add a a group. I can add a specific user as a visitor that work fine. The group itself is a cloud created o365 group and the name will never change it will just be used to manage access across all the sites. I know this needs to be done with a HTTP request but i cannot work out what the body code should be to add a group and not a user. Any advice would be brilliant.
Thanks
Solved! Go to Solution.
I managed to solve this using the below as the setting for the Send HTTP request to sharepoint.
Method - POST
URI - /_api/web/sitegroups(4)/users (this adds groups to the visitors sharepoint permission group)
Headers:
accpet = application/json;odata.metadata=none
content-type = application/json;odata=verbose
{ '__metadata': { 'type': 'SP.User' }, 'LoginName': 'c:0t.c|tenant|<Group OBJECT ID>'}
I got the Group Object ID from Azure AD, this works for any group as long it doesn't have a another group assigned to it, so it is all users, i am using an on prem created Security Group as we wanted to only have to manage one group for giving access to all our Client Hubsites.
I wanted my group added as visitors to each site that is created through Automate, so used the sitegroups(4) this seems to always be Visitors permission group for each newly created site, you can get the sitegroups number by going to Site Settings/Site Permissions - click the group you want to know the ID for and it will show the URL bar.
hope this helps someone else.
I managed to solve this using the below as the setting for the Send HTTP request to sharepoint.
Method - POST
URI - /_api/web/sitegroups(4)/users (this adds groups to the visitors sharepoint permission group)
Headers:
accpet = application/json;odata.metadata=none
content-type = application/json;odata=verbose
{ '__metadata': { 'type': 'SP.User' }, 'LoginName': 'c:0t.c|tenant|<Group OBJECT ID>'}
I got the Group Object ID from Azure AD, this works for any group as long it doesn't have a another group assigned to it, so it is all users, i am using an on prem created Security Group as we wanted to only have to manage one group for giving access to all our Client Hubsites.
I wanted my group added as visitors to each site that is created through Automate, so used the sitegroups(4) this seems to always be Visitors permission group for each newly created site, you can get the sitegroups number by going to Site Settings/Site Permissions - click the group you want to know the ID for and it will show the URL bar.
hope this helps someone else.
Thank you for your detailed response.
can anyone help me , I have same requirement and followed same steps as mentioned above but getting error.
"User doesn't exists or not unique"
Hi @sparipal ,
I had the same issue. Above works fine if you've a security group.
When you try to add an Office 365 group (like me), then you should use:
c:0o.c|federateddirectoryclaimprovider|
Hope it will help you
Regards,
Dennis.
Hello Dennis,
I tried it and it worked thank you so much
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
66 | |
23 | |
16 | |
16 | |
11 |
User | Count |
---|---|
121 | |
36 | |
32 | |
27 | |
27 |