Get users in Powerapps from Office 365 group

Loading

Requirement: Get the information of a user from a specific SharePoint group in PowerApps. The SharePoint Group ID and how to display all the SharePoint Group member information using the Powerapps Gallery Control.

Create a blank canvas app, Add Office 365 Group connection to the Screen. Now Insert Classic Button control to the screen, On Text Property “Get Group Members from SharePoint Group”. On OnSelect Property:

ClearCollect(SharePointGroupMembers,Office365Groups.ListGroupMembers("d66f0937-5704-4152-b4e6-bfee81a8eadd").value)
  • 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

Get SharePoint Group ID from Group itself :

  1. Open any existing SharePoint Site and hit on the Settings icon.
  2. Click on Site permissions -> Advanced permissions settings.
  3. Next, it will open the page (People and Groups) to see all the SharePoint Groups. Click on specific SharePoint Group that you want to get the ID.
  4. 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.

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

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

Leave a Reply

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