Get users from Office 365 Group in PowerApps

In this PowerApps Tutorial, we will discuss how to get users from Office 365 group in PowerApps. We can easily get the information of a user from a specific SharePoint group in PowerApps.

Also, We will see what are the different ways to get the SharePoint Group ID and how to display all the SharePoint Group member information using the Powerapps Gallery control.

Powerapps get user group membership

Normally, When you work with Powerapps to get the User’s information from a SharePoint Group, Most of the people are using Microsoft Powerapps Flow.

Yes, you can use Microsoft Flow undoubtedly, but there is also the easiest and tricky way to get the user from the SharePoint group without using Microsoft Flow.

You can get the SharePoint Group Members directly using the PowerApps Office 365 Groups connector.

The below screenshot represents a Microsoft Office 365 SharePoint Group named PowerAppsGroup. This SharePoint group contains only two Members as shown below.

I want to get and display these two users information in the Powerapps screen.

get users from sharepoint group in powerapps

Powerapps list group members

  • Sign in the PowerApps app with your credentials.
  • Create a blank new Canvas app and choose any one Layout either Tablet or Phone.
  • First of all, you need to add the Office 365 Groups connector to the Powerapps screen.
  • Go to View tab -> Data sources -> Search Office 365 Groups in the search box -> Add a new connection or existing connection as below.
get users from a sharepoint group in powerapps
  • On the PowerApps screen, insert a Button (Insert -> Button). Select the Button and set its Text property as “Get Group Members from SharePoint Group“.
  • Select the Button and apply this below formula on its OnSelect property as:
OnSelect = ClearCollect(SharePointGroupMembers,Office365Groups.ListGroupMembers("1dfb19e0-25fc-44a6-8016-f92a064d1d34").value)

Where,

  • ClearCollect = This function helps to create Powerapps collection where it will clear all the previous data and always store the new one.
  • SharePointGroupMembers = Collection Name
  • Office365Groups.ListGroupMembers(“Group ID”) = It helps to get the information about all the users from the specific SharePoint Group

If you are new to Powerapps Collection, then refer these below articles:

powerapps get members from SharePoint group

Follow this below content to find out the SharePoint Group ID.

Get Group ID from SharePoint

You can get any SharePoint Group ID by using three different ways:

  1. Get SharePoint Group ID from Group itself
  2. Get Group ID from any SharePoint Groups
  3. Get Group ID from Azure Portal
  1. Get SharePoint Group ID from Group itself

Follow the below steps to retrieve the SharePoint Group ID from the SharePoint group itself:

  • Open any existing SharePoint Site and hit on the Gear icon from the right top of the page.
  • Click on Site permissions -> Advanced permissions settings as shown below.
get members from SharePoint group in powerapps
  • Next, it will open the page (People and Groups) where you can see all the SharePoint Groups. Click on your specific SharePoint Group that you want to get the ID.

Note:

If in case, you can not see your specific SharePoint Group, then click on any group that are visible on the Permission page. From the left side navigation, click “More” options under the Groups section. Once you will click on More, you can see all the SharePoint Groups as like the below screenshot.
get members from a SharePoint group in powerapps
  • Next, the SharePoint Group ID will appear as below. Just copy the Group ID (only highlighted portion) that is present in the Account section and save it in one Notepad. You can use this Group ID in your Powerapps app.
powerapps list group members

2. Get Group ID from any SharePoint Groups

Follow the below steps to retrieve the SharePoint Group ID from any SharePoint groups:

  • Do the same previous steps till opening the People and Groups page.
  • Open any existing SharePoint Group like “PowerApps Owners” and add a group as a user or member over there. Select New -> Add Users as shown below.
powerapps list group users
  • Select Invite people -> Enter the SharePoint Group name (PowerAppsGroupMembers) that you want to get the ID -> Click on the Share button.
powerapps list group member
powerapps list group member
  • Next, the SharePoint Group will be added as a user into the PowerApps Owners group. Once you will click on the group, then you can see the Group ID in the Account section as shown below.
  • Just copy the Group ID and paste it in a Notepad. Later, use this group ID in your Powerapps app to get the User details.
get users from sharepoint group using powerapps

3. Get Group ID from Azure Portal

  • Open your Azure Portal and Search for Groups in the search box.
  • Select the specific group for more information.
  • You can see the Group ID in the Object Id field. Just copy the ID and paste it in one Notepad. You can use this ID in your Powerapps app.

To display all the Group Members’ information, We need to add a PowerApps Gallery control on the Powerapps screen.

  • Insert a Gallery control (Insert -> Gallery -> Vertical).
  • Add the Collection Data source (Select the Gallery -> Properties -> Data source -> SharePointGroupMembers) in the Gallery control. The Collection that you have created in the Button control above.
Powerapps find members from SharePoint group
  • Select the Gallery control Layout as Title and Subtitle.
  • Edit the Fields and provide these below options:
  1. Title: displayName
  2. Subtitle: mail
Display Group Members in PowerApps Gallery
  • Now just Preview (F5) the Powerapps app and hit on the Button (Get Group Members from SharePoint Group).
  • In the Gallery control, you can see all the User Display Name and Email those are present in the specific SharePoint Group.
Display SharePoint Group Members in PowerApps Gallery
  • Next, go to the PowerApps Collection (View -> Collections) where the user information has been stored.
Display Group users in PowerApps Gallery

Also, you may like these below PowerApps Tutorials:

In this PowerApps Tutorial, We discussed how to get users from a specific SharePoint group in PowerApps.

Also, We saw how to get the Group ID from SharePoint using different ways and display all the SharePoint Group members using the Powerapps Gallery control.

  • Thank you Bijay!
    I’m using this now, but getting stuck at the 100 item limit. Any idea how I can combine Top function with the clearcollect so i can get at least 250 users?

    • There is a second parameter you can pass to increase the limit.
      Office365Groups.ListGroupMembers(“group-id-here”,{‘$top’:250}).value

      Limit for the connector is 999

  • So, this article shows user from Office365 group which is added in SharePoint groups for then you can get it. Apparently, there is no way to get user from SharePoint group without using o365 group.

  • I think the group you are pertaining to is not a Sharepoint Group. That is an Office365 Group. Office 365 groups are problematic when assigned permission to a sharepoint site, list, etc.

  • Your article should be altered. Swap out “SharePoint Groups” for “Office 365 Groups”. Your wording isn’t really right in this case.

  • It’s exactly as others have pointed out already: Sharepoint group members cannot be obtained this way, your guide only works for o365 group members. Pls update, so others don’t get confused.

  • Thats great! What about a separate SharePoint permission group created locally on the SharePoint site? How to list the members of that group?

  • Thank you but how do you get over the 999 limit? I guess I should try a filter but what’s the syntax for that? Thanks

  • This article is misleading. In this sample, Office 365 Group membership is displayed not SharePoint Group members.

  • Hi Bijay, Is there any way to read more than 2000 users from office365 user group. I tried {$skip: value, $top:value} in the above function. But, It is not giving the expected results.

  • >