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

Search Group List returned from Office 365 Group Connector

I am trying to utilize the Office 365 Groups Connector in my powerapps. Basically I want to be able to pull the list of users in a group, check if the current users email is in that group, if so display "A Button", if not display "B Button". A little more complicated than that, but I am struggling to just view the values returned from the list.

 

I have set up the connector to my PowerApp and am trying to get a list of all the members of a group using Office365Groups.ListGroupMembers('groupId'). I can't figure out if this is working because it returns an Array of users and I don't know how to get that list to even appear on a blank powerapps page just to see the values. I can't set it to a labels text property because it is expecting a string and there doesn't appear to be a way to return like the first value in an array like groupList[0]. Any idea how I could display this array onto a powerapps page just to see the values being returned?

 

If so, any thoughts on how to search this array for an email?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Search Group List returned from Office 365 Group Connector

Hi @asAdmin

 

To visualize this array you can ClearCollect it and look the content of your collection by clicking on 'File' > 'Collection'

You can add a button and set the OnSelect property to :

Clearcollect(MyGroupUsers,Office365Groups.ListGroupMembers('groupId'))

Or you can use a Gallery to display the users on a screen :

'Insert'>'Gallery', and set the Items property of the gallery to

Office365Groups.ListGroupMembers('groupId')

The Labels within the gallery must be set according to your array's properties

For example, Label.Text : ThisItem.DisplayName

 

Theo

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Search Group List returned from Office 365 Group Connector

Hi @asAdmin

 

To visualize this array you can ClearCollect it and look the content of your collection by clicking on 'File' > 'Collection'

You can add a button and set the OnSelect property to :

Clearcollect(MyGroupUsers,Office365Groups.ListGroupMembers('groupId'))

Or you can use a Gallery to display the users on a screen :

'Insert'>'Gallery', and set the Items property of the gallery to

Office365Groups.ListGroupMembers('groupId')

The Labels within the gallery must be set according to your array's properties

For example, Label.Text : ThisItem.DisplayName

 

Theo

View solution in original post

asAdmin
Level: Powered On

Re: Search Group List returned from Office 365 Group Connector

That worked thank you!

crf200
Level: Powered On

Re: Search Group List returned from Office 365 Group Connector

I've been trying this same thing but can't seem to get it to work.

 

I'm trying to get the users returned from a 365 Group:

 

Office365Groups.ListGroupMembers('groupID').value.mail


Then make a button visible if the Office365Users.MyProfile().Mail is within that array.

 

I can't even get the ListGroupMembers to return an array into a lable text. The error is saying "The function 'ListGroupMembers' has some invalid arguments."

 

I pulled the Group ID from a MS Flow run that I ran that returned the data I'm looking for.

Highlighted
SumanthDundi7
Level: Powered On

Re: Search Group List returned from Office 365 Group Connector

@asAdmin , I need to implement the same.. Can you please help me with the steps on how achieved this? 

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,409)