Skip to content

Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Problems
  • Triggers
  • Application specific solutions
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Resources
Menu

How to get Microsoft 365 group owners in Power Automate

Posted on June 12, 2022June 12, 2022 by Tom

“There’s an action to list M365 group members, but what about the group owners, does Power Automate have an action to get them?”


Power Automate takes a different approach on M365 groups depending on user roles. You can easily work with members using designated actions, but there’s no action for owners. If you want to work with the owners, you must do that via the Graph API. That applies to all operations, let it be listing the owners, or removing them. But how do you call the Graph API?

Get the group ID first

Unless you know the M365 group ID, you’ll have to get it first as the call needs it. Get it by listing all the groups you own or belong to, and filter by the group name.

The outcome of the ‘Filter array’ will be just the single group, and its ID will be among the dynamic contents.

Send the request to Graph API

A full HTTP request is a premium action in Power Automate, but there’s another action that’s included in the free version. It’s called ‘Send an HTTP request’ and you can find it in the Office 365 Groups group of actions.

Add the action to your flow to send the HTTP request below.

Method: GET

Uri: https://graph.microsoft.com/v1.0/groups/<groupID>/owners

Note: <…> is a placeholder, replace it including the < and > with the group ID.

Don’t worry about the ‘Apply to each’. If you use the output of the ‘Filter array’ it’ll contain only a single group = it’ll run only once.

Power Automate get group owners

Extract the owners

Since it’s an HTTP request, it’ll provide the output only as a whole JSON. It won’t parse it to dynamic contents for each of the returned values. But that’s no problem as you can extract the values from the JSON directly.

The owners will be stored in the ‘value’ array, so you can easily ‘Select’ the values you’re interested in. Use the array with the users as the input, and select the value, e.g. their email.

Input:
body('Send_an_HTTP_request')?['value'] 

Map:
item()?['email']
Power Automate get group owners

You’ll get an array with email addresses of the owners of this specific M365 group.

Summary

As in so many situations before, when there’s no dedicated action, the solution is an HTTP request. Get the group ID, ask Graph API for the owners, and then extract them from the result using ‘Select’ and expressions. You just used Power Automate to get the group owners and you can process them later in the flow.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

1 thought on “How to get Microsoft 365 group owners in Power Automate”

  1. Pingback: List M365 Group owners with Graph API query parameters – Expiscornovus

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Now available:

The Ultimate Power Automate expressions cheat sheet
Equip yourself with the tool to translate your thoughts into Power Automate expressions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Hello and welcome!

My name is Tom and I'm a business process automation consultant and Microsoft MVP living in the Czech Republic. I’ve been working with Microsoft technologies for almost 10 years, currently using mainly Power Automate, SharePoint, Teams, and the other M365 tools.

I believe that everyone can automate part of their work with the Power Automate platform. You can achieve a lot by "clicking" the flows in the designer, but you can achieve much more if you add a bit of coding knowledge. And that's what this blog is about.

To make the step from no-code Power Automate flows to low-code flows: using basic coding knowledge to build more complex yet more efficient flows to automate more of your daily tasks.

  • Format results of date calculation in SharePoint columnJune 29, 2022
  • Why is your Power Automate flow creating duplicatesJune 26, 2022
  • How to create a unique identifier in your Power Automate flowJune 22, 2022
  • How to assign custom SharePoint permission level with Power AutomateJune 19, 2022
  • Remove permissions from a specific SharePoint user with Power AutomateJune 15, 2022

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

© 2022 Let's POWER Automate | Powered by Superbs Personal Blog theme