In this Power Apps tutorial, we will discuss how to fetch Azure groups in PowerApps using PowerApps Azure AD Connectors. Here we will bind the Azure groups into a dropdown list in PowerApps.
Microsoft provides Azure AD connectors to connect with Azure AD from Microsoft Power Apps.
PowerApps Azure AD Connectors to fetch Azure groups
First, we will create a canvas app from the PowerApps.com site.
If you are new to PowerApps Canvas App, check out the below URLs:
- How to Create a Canvas app from SharePoint List in Power Apps
- Create a canvas app from Excel in Power Apps (Step by Step tutorial)
Here create an app and you may choose Phone layout or Tablet layout.
Then add two controls in your screen: Combo box and a button control from Power Apps input controls.
The PowerApps screen looks like below:
Log in to the Microsoft Azure and create a group in Azure AD.
Below are the four AD groups I have created in my Azure portal.
Next, go to the PowerApps and go to the data source and create a new connector called AzureAD.
To use Azure AD connector, you required the below permission.
- Group.ReadWrite.All
- User.ReadWrite.All
- Directory.ReadWrite.All
Next, click on the button and go to the property screen and go to Advance settings. Add the below code inside the onSelect section.
ClearCollect(
AllGroups,
AddColumns(
AzureAD.GetMemberGroups(User().Email,false).Value,
"GroupName",
AzureAD.GetGroup(Value).mail
)
)
Next, go to the Power Apps combo box properties and add the below properties that I have highlighted as the yellow mark.
Properties are DisplayFields, SearchFields and Items etc.
Next, run the app and see my all azure groups are populating over there in the Power Apps combo box.
You may like following Power Apps tutorials:
- PowerApps form benefits for SharePoint
- How to view PDF files using PDF Viewer in PowerApps
- How to Play Microsoft stream Videos in Power Apps
- PowerApps Combobox from SharePoint List
- How to create a PowerApps Canvas app from Excel OneDrive for Business data source
- PowerApps Examples: Restaurant management system
In this tutorial, we learned how to use PowerApps Azure AD Connectors to fetch azure groups in powerapps.
Also, we saw how to bind the Azure AD groups to a combo box in Power Apps using the AD connectors.
Rajkiran is currently working as a SharePoint Consultant in India . Rajkiran having 7+ years of experience in Microsoft Technologies such as SharePoint 2019/2016/2013/2010, MOSS 2007,WSS 3.0, Migration, Asp.Net, C#.Net, Sql Server, Ajax, jQuery etc.He is C#Corner MVP (2 Times).
Thanks a lot, wasn’t able to solve this puzzle by myself.
Is there a way to get all AD groups even ones you’re not a part of?