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

Get Azure AD group by name/title

Hi,

 

I'm creating a flow that is supposed to get users from an Azure AD group and start an Approval based on this. Now, the way I need to do this is (I'm not going to go into why it has to be this way):

A string variable is built to represent the name of the Azure AD group I need to get.

 

So, I can't find a way to get an Azure AD group based on it's name - only it's unique ID (which I don't have).

 

The question is: How can I get an Azure AD group based on it's name? Or, how can I get the ID of the Azure AD group I need - based on it's name?

 

Any help would be highly appreciated!

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Get Azure AD group by name/title

Looking at the get group API you need to use the group ids

 

https://msdn.microsoft.com/Library/Azure/Ad/Graph/api/groups-operations#GetAGroup

 

You could possibly make use of Get-Groups but I haven't foudn anythign directly in Flow that you can use.

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Get Azure AD group by name/title

Looking at the get group API you need to use the group ids

 

https://msdn.microsoft.com/Library/Azure/Ad/Graph/api/groups-operations#GetAGroup

 

You could possibly make use of Get-Groups but I haven't foudn anythign directly in Flow that you can use.

View solution in original post

Administrator
Administrator

Re: Get Azure AD group by name/title

Hello, @HelgeNorvang!

Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @Pieter_Veenstra‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!


Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

-Gabriel
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!
Troxel
Level: Powered On

Re: Get Azure AD group by name/title

I am not sure why @Pieter_Veenstra‘s recommendation is marked as a solution.  He basicly said he didn't have a solution, then took a shot in the dark by sending a link to a reference for an API call that asks for the GUID of the group as the argument.  The original post says that the problem is the GUID is not known, so this is not a solution.  I am not mad since i would probably do the same thing 🙂

 

However, the question is still not answered.  In flow, with the Azure AD connector, how do you get the GUID of a group by giving the name of the group?

LozzieD
Level: Powered On

Re: Get Azure AD group by name/title

You might try wrestling with the HTTP request action and call the Microsoft Graph to retrieve the list of groups.  Then filter the group names retrieved to find (or not find) the one you're looking for, and look up the GUID from the record with the name.

 

This has been made a little simpler by dropping the older requirement to do a HTTP action "double tap":  One HTTP action to get the token, the second one to retrieve the list of groups.  The HTTP action now has the get the token piece in its properties.

 

This example from John Liu actually specifies the Microsoft Graph call for getting a list of groups - details here ...

 

https://docs.microsoft.com/en-us/graph/api/group-list?view=graph-rest-1.0

 

... - as its Microsoft Graph call ...

 

https://johnliu.net/blog/2018/1/setting-up-msgraph-webhook-with-http-action-in-microsoftflow 

 

When you register the app ...

 

https://docs.microsoft.com/en-us/graph/auth-register-app-v2 

 

... you will have to get a tenant admin to grant admin consent on the permissions you need to enumerate the group list.  These permissions are "Read all groups" and possibly "Read directory data".

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 239 members 5,289 guests
Please welcome our newest community members: