cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Highlighted
Memorable Member
Memorable Member

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

5 REPLIES 5
Highlighted
Memorable Member
Memorable Member

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

Highlighted
Frequent Visitor

Re: Search Group List returned from Office 365 Group Connector

That worked thank you!

Highlighted
Advocate III
Advocate III

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
Helper I
Helper I

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? 

Highlighted
Frequent Visitor

Re: Search Group List returned from Office 365 Group Connector

If you still need this, something like this should work:

 

If(LookUp(Office365Groups.ListGroupMembers("[groupid]").value, mail = Office365Users.MyProfileV2().mail,mail) = "false", false, true)
the lookup will return either an email address, or false, unfortunately you can just put the lookup in the visible property, so you need to use an if statement.
 
This has worked for me!
 
Rob

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,633)