Requirement: Get employee details from Office 365 users in Powerapps using ComboBox
Create a blank canvas app, add ComboBox and the labels as the information present in the office 365 users to display in Powerapps
Add the below formulae in ComboBox:
Items Property:
Office365Users.SearchUser({searchTerm:ComboBox2_1.SearchText}).DisplayName
OnChange Property:
If(IsEmpty(ComboBox2_1.SelectedItems), Clear(ColOffice), ClearCollect(ColOffice, Office365Users.SearchUser({searchTerm:ComboBox2_1.Selected.DisplayName})));
Here we need to get the Value from Office 365 users using ComboBox for Searching-Search for users: Retrieves search results of user profiles.
For Search users the Name,DataType,Required Description,searchTerm string,no Search string-display name, given name, surname, mail, mail nickname, and user principal name.
Property Name | Type | Description |
City | String | City of user |
CompanyName | String | Company of user. |
Country | String | Country of user. |
Department | String | Department of user. |
DisplayName | String | Display name of user. |
GivenName | String | Given name of user. |
Id | String | User id |
JobTitle | String | Job title of user |
String | Email id of user | |
MailNickname | String | Nickname of user. |
mobilePhone | String | Mobile phone of user. |
OfficeLocation | String | Office location of user. |
PostalCode | String | Postal code of user. |
Surname | String | Surname of user. |
TelephoneNumber | String | Telephone number of user. |
UserPrincipalName | String | User Principal Name. |
AccountEnabled | Boolean | Account enabled flag. |
BusinessPhone | String | Phone numbers of user’s company. |
Now add Labels, add the below information to them.
Bordercolor- LightGray
BorderRadious-2
BorderThickness-Solid
Label 1.1-Text Property: First(colOffice).DisplayName
Label 2.1-Text Property: First(colOffice).Department
Label 3.1-Text Property: First(colOffice).JobTitle
Label 4.1-Text Property: First(colOffice).City
Label 5.1-Text Property: First(colOffice).Country
Label 6.1-Text Property: First(colOffice).OfficeLocation
Label 7.1-Text Property: First(colOffice).UserPrincipalname
Now Preview the App and Select the Employee name