cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
scutiyog
Level: Powered On

Change SharePoint Group Owner with Flow

Hi,

I've got a flow that creates a security group on my site and that works fine when just setting the title of the group.  What i cannot figure out is how to change the Group Owner for that security group (since it defaults to the owner of the flow).

I have an Http request that creates the group -

flow1.JPG

This works great. 

If I add under title - "Owner":"username" or "Owner":"Another security group name" it throws an error 400 about primitiveValue nodes.

If I create the security group with just a title, parse json to get the proper id and then create a second Http request to update the owner - i still get errors about either cannot find resource or invalid request.

I  have tried using URI  _api/web/sitegroups(1085)/owner or _api/Web/SiteGroup/GetById(1090)

and the body as

{
"_metadata": (
"type":"SP.Group"
}
"SPGroup.Owner":"{'ID':'9'}"

Or 

{
"_metadata": (
"type":"SP.Group"
}
"Owner":"{'ID':'9'}"
}

i also tried using the name of the security group i want as the owner.  I've tried just putting in a single individual account name to see if i could do even that but no go.

 

I saw this thread - https://sharepoint.stackexchange.com/questions/198710/changing-the-owner-of-a-group-via-rest-api but the 1 answer it got made no sense to me as it just seemed to say what the OP already said.

 

I'm sure it's something i'm missing that maybe easy, but i'm stumped.

 

Does anyone know how you can change the group owner for a sharepoint group with Flow?

 

Thanks!

 

2 REPLIES 2
Highlighted
Super User
Super User

Re: Change SharePoint Group Owner with Flow

The SharePoint Connector for Flow has some limitations, so this is likely something you'll need to accomplish either via the SharePoint REST API, and/or via an Azure Function that utilizes the Owner property via the SP.Principal type. 

The Group Properties API reference has the Owner property listed as having a No for the Returned with a resource flag. I'm not a SharePoint developer, but from my personal experience this means that you likely can't return anything from that property via an HTTP request. 

For this reason, your best and easiest bet may be to create and call an Azure Function that runs a PowerShell script to change the group owner as desired.

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

scutiyog
Level: Powered On

Re: Change SharePoint Group Owner with Flow

I have never worked with Azure functions - do you know of any site that might be a good start for me to test that route?

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 412 members 4,733 guests
Please welcome our newest community members: