Change group owner using Microsoft Flow

Change group owner using Microsoft Flow

In this article we are going to have a look on how to assign a group as owner of another group using Microsoft flow or power automate.


If you want to create a SharePoint group from flow then have a look on

Create SharePoint group from flow

If you want to see how to add users to a group from Microsoft Flow then have a look on How to add users to SharePoint using MS Flow


For simplicity, suppose we have a  target group and we want to change the owner to target group to SharePoint site owner 

Setting a group as owner of another group is currently not possible with rest and so we will have to use soap based request. lets say that we know the source group id and target group id. 

From user interface you can get group id by navigating to site settings >> Site permissions >> click on any group  and in the url you will get the group id as value of query string parameter MembershipGroupId

Alternativelly you can get the group id's in Flow it self. to konw how you can have a look on How to add users to SharePoint using MS Flow


Lets start creating workflow

Create a mannually triggered flow

In order to create a mannually triggered flow, follow below steps.

  1. Go to

  2. Click on My flows in left section

  3. Click new top and select Instant - from blank

  4. Choose mannually triggred flow and click Create

At this time your flow will be created.  now lets create two varriables

Click add new step and search for initialize varriable and add a varriable 

Varriable name : targetgroupid

Type : number

Value : target group id 

Similarly add a new initialize varriable step as below

Varriable Name : ownergroupid

type : number

Value : group id of owner group


Get Site Id

In order to assign permissions, we will need the Id of the site. and thus we need to query on _api/site endpoint. follow below steps to get site id

  1. Add a new step "Send an HTTP request to SharePoint"
  2. Enter site address
  3. In Method choose GET
  4. in Uri enter _api/site
  5. Add two headers accept and content-type and value of both will be application/json;odata=verbose

And we are done here. we will need to parse the response to get site Id. run the the flow once and from run history copy the response body of above activity.


Add a new step Parse JSON as enter below values

1. In Body enter body from get site id

2. In schema , click generate from sample and paste the response copied above

Now we will be able to get site Id from this step


Add group owner

To add group owner follow below steps.

  1.  Add a new step "Send an HTTP request to SharePoint"
  2. In the address, Select your site address
  3. In method select POST
  4. In Uri, enter _vti_bin/client.svc/ProcessQuery
  5. Add header content-type and set the value as text/xml
  6. In body paste below
  7. <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="" LibraryVersion="" ApplicationName=".NET Library" xmlns="">
                    <SetProperty Id="1" ObjectPathId="2" Name="Owner">
                      <Parameter ObjectPathId="3" />
                    <Method Name="Update" Id="4" ObjectPathId="2" />
                    <Identity Id="2" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:siteguid:g:target_group_id" />
                    <Identity Id="3" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:siteguid:g:owner_group_id" />


Replace siteguid , target_group_id and owner_group_id

Group id is a number. when you open a group in browser then value of query string parameter MembershipGroupId will be group id.

And you are done. Test the flow by mannually triggering and see the result


SharePoint Online
Microsoft Flow

Would you like to see your article here on tutorialsinhand. Join Write4Us program by

About the Author
Mukesh Tiwari
Always ready to learn new technologies, A problem solver, exhibit to do attitude. Having around 10+ years of experience of development and management skills. I believe don't just set random goals but right goals suited for you.
Page Views :    Published Date : Jun 27,2020  
Please Share this page

Related Articles

Like every other website we use cookies. By using our site you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Learn more Got it!