Get Employee details from Office 365 in Powerapps

Loading

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 NameTypeDescription
CityStringCity of user
CompanyNameStringCompany of user.
CountryStringCountry of user.
DepartmentStringDepartment of user.
DisplayNameStringDisplay name of user.
GivenNameStringGiven name of user.
IdStringUser id
JobTitleStringJob title of user
MailStringEmail id of user
MailNicknameStringNickname of user.
mobilePhoneStringMobile phone of user.
OfficeLocationStringOffice location of user.
PostalCodeStringPostal code of user.
SurnameStringSurname of user.
TelephoneNumberStringTelephone number of user.
UserPrincipalNameStringUser Principal Name.
AccountEnabledBooleanAccount enabled flag.
BusinessPhoneStringPhone numbers of user’s company.
Office365Users.SearchUser- Employee details

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

Leave a Reply

Your email address will not be published. Required fields are marked *