Show all O365 users in a Power App

I want to show all users in my Office 365 environment in my Power App in a Combo box control from which the user can select.

We can accomplish this by adding the Office365Users data source to our app and then doing a search that will return all users. The search results are stored in a local collection. I like to do this so that we can use the local collection throughout the app, eliminating the need to repeat the user search.

Add the O365 Data Source

  • Select the Data pane.
  • Select Add data.
  • Select Office365Users.

Search for all users

  • In the App.OnStart, add the following formula. It will return 999 users where the OfficeLocation is “ReturnAll.” Unless you have an Office Location called “ReturnAll,” this search should return everyone.
ClearCollect(colO365Users, Filter(Office365Users.SearchUser({searchTerm:"", top:999}), OfficeLocation <>"ReturnAll"))
  • Run the App.OnStart or restart your app to load the data.
  • Use the colO365Users collection in your ComboBox Items property.
Eric Gregorich @ericgregorich