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?
Solved! Go to Solution.
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
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
That worked thank you!
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.
@asAdmin , I need to implement the same.. Can you please help me with the steps on how achieved this?
If you still need this, something like this should work:
If(LookUp(Office365Groups.ListGroupMembers("[groupid]").value, mail = Office365Users.MyProfileV2().mail,mail) = "false", false, true)
User | Count |
---|---|
260 | |
109 | |
93 | |
57 | |
41 |