Mustafa Alqanbar
Mustafa Alqanbar

Reputation: 47

PowerApp unable to get all Users states

I'm try to get all user state from office365User

Office365Users.UserProfileV2(Office365Users.MyProfile().Id).state

However, it's not a solution because it will retrieve my information only. as I would like to get all stats of our 365 users on combo box.

thanks for your help in advanced

Upvotes: 0

Views: 1352

Answers (1)

RickWeb
RickWeb

Reputation: 2115

You might struggle to do it all in a combo box, you can do it in a gallery thought.

There is no list users, so to get all the users you have to use the searchUser function if your search string is blank it returns all the users.

Office365Users.SearchUser({searchTerm: TextSearchBox1.Text}) 

Gallery

Items set to

Office365Users.SearchUser({searchTerm: TextSearchBox1.Text}) 

Then a label within the card set the text to

Office365Users.UserProfileV2(ThisItem.UserPrincipalName).state

Combo Box

To get the state I had to place a label next the combo box, I was unable to get it work from the

Items set to

Office365Users.SearchUser({searchTerm: TextSearchBox1.Text}) 

then set the label text set to

Office365Users.UserProfileV2(ComboBox1.SelectedItems.UserPrincipalName).state

Useful links

Connect to Office 365 Users connection from PowerApps

Office 365 Users Connection Overview

Upvotes: 1

Related Questions