Power Apps Combo Box Search Office365Users

Did you need to connect the Power Apps Combo box control to Office 365 users? If so, no worries!

In this Power Apps tutorial, I will explain the “Power Apps Combo box search Office365Users”.

Moreover, I will show you how to exclude guest users from the Power Apps combo box control with Office365Users, and we will also see:

  1. How to filter the Power Apps combo box with Office365Users
  2. Power Apps combo box with Office365Users default
  3. Create a Power Apps collection using people picker

Power Apps Combo box with Office 365 Users

This section will show you how to use a Power Apps combo box to search Office 365 users.

Example,

I created a Power Apps Canvas app and then added a Combo box control connected to Office365Users. Whenever the user expands the combo box control, it displays the list of office365 users as shown below:

Using Power Apps combo box to search office 365 users

To achieve it, follow the below steps:

  • Sign in to your Power Apps with your valid Microsoft 365 credentials.
  • Create a Power Apps Blank canvas app -> Connect the data source as Office365Users as shown below:
Power Apps Combo box search office 365 users
  • On the Power Apps screen, insert a Combo box control -> Set its Items property to:
Office365Users.SearchUser({searchTerm: cmb_Office365Users.SearchText})
Power Apps combo box to search office 365 users
  • SavePublish, and Preview the app. Now, the combo box control contains the users from Office 365.
How to build People Picker in Power Apps with Office 365 Users Search

If you need to display a department with their name. Follow the below steps:

Show display name and department in a Power Apps combo box control

Here, I will show you how to display the name and their department in the Power Apps combo box control.

  • Select the Combo box control -> On the combo box properties pane, click on Edit fields
  • Select the layout as Person -> Then choose Primary text as “Display Name” and Secondary text as “Department” as shown below:
Power Apps combo box with Office 365 Users search
  • SavePublish, and Preview the app. When the user expands the combo box control, it displays the user’s name with their department.
How to set Power Apps combo box with Office 365 Users Search

As per the screenshot below, the Power Apps combo box will also display the guest users.

Power Apps combo box Office 365 users allow search

To avoid the guest user in the Power Apps combo box control, follow the below steps:

Exclude guest users from the Power Apps combo box with Office365Users

Here, let me show you we can avoid displaying the guest users in the Power Apps combo box control.

Example,

On my Power Apps screen, a Combo box control is connected to an Office365Users. Whenever the user expands the combo box control, it will display the user name to avoid the guest users.

Build People Picker in Power Apps with Office 365 Users Search

To achieve it, follow the below steps:

  • Select the Combo control -> Set its Items property to:
Filter(
    Office365Users.SearchUser({searchTerm: cmb_Office365Users.SearchText}),
    AccountEnabled = true && Not("#EXT#" in UserPrincipalName)
)
How to set Power Apps combo box with office 365 users
  • SavePublish, and Preview the app. Now, the Power Apps combo box control contains the users from Office 365 by avoiding the guest users.
Power Apps Combo box with office 365 users

This is how we can exclude the guest users from the Power Apps combo box with Office365Users.

Power Apps Office365Users filter by department

Here, I will show you how to filter the Power Apps combo box control connected to Office 365 users.

Example,

I created a Power Apps Canvas app and then added a Combo box control connected to Office365Users. Next, Whenever the user expands the combo box control, it displays the users who all are in the “Marketing” team, as in the screenshot below:

Power Apps Combo box office 365 users filter

To achieve it, follow the below steps:

  • On the Power Apps screen, insert Combo box control -> Set its Items property to:
Filter(
    Office365Users.SearchUser(
        {
            searchTerm: cmb_UserFilter.SearchText,
            top: 0
        }
    ),
    Department = "Marketing"
)

Where,

  1. cmb_UserFilter = Combo box control name
Filter Power Apps Combo box office 365 users
  • SavePublish, and Preview the app. Now, the combo box control contains the users from only the marketing team.
Power Apps Combo box with office 365 users filter

This is how to filter the Power Apps combo box control with Office365Users.

Power Apps Combo box with Office365Users default

In this section, I will show you how we can assign a default person value for a Power Apps combo box control.

Default means whenever the user opens the Power Apps app, by default one user will be selected in the combo box control.

Here, I am showing two different scenarios like by assigning the Power Apps combo box default value as the “Current user” and a “Manager“.

Power Apps Combo box with office 365 users default

Follow the below steps to achieve it:

For Current User

  • On the Power Apps screen, insert a Combo box control -> Set its combo box properties to:
Items = Office365Users.SearchUser({searchTerm:cmb_Office365Users.SearchText})

DefaultSelectedItems = Office365Users.SearchUser({searchTerm: User().Email})

Where,

  1. cmb_Office365Users = Combo box control name
How to use Power Apps combo box to search office 365 users
  • Save, Publish, and close the app. Then, reopen and preview the app. By default, the combo box control value will be selected as the current user name, as shown below:
Power Apps Combo box with Office365Users default

This is how to set the Power Apps combo box Office365Users default user value as the current user.

For Manager

  • Insert a Combo box control -> Set its combo box properties to:
Items = Office365Users.SearchUser({searchTerm:cmb_Office365Users.SearchText})

DefaultSelectedItems = Office365Users.Manager(User().Email)
How to set Power Apps combo box with Office365Users default
  • Save, Publish, and close the app. Then, reopen and preview the app. By default, the combo box control value will be selected as the manager name, as shown below:

This is how to set a Power Apps combo box default value with Office 365 users.

Create a Power Apps collection using people picker

Here, I will show you how to create a Power Apps collection using a combo box people picker.

Example,

I have created a Power Apps Canvas app and then added a Combo box control and Data table. Later, I connected the combo box to Office365Users and created a collection to display their email and departments.

Whenever the user selects the user from a combo box, that will create a collection with their email and department. Simultaneously, that will be presented in the data table.

Follow the below steps to achieve it:

  • On the Power Apps screen, insert a Combo box control -> Set its combo box properties to:
Items = Office365Users.SearchUser({searchTerm: cmb_UserCollection.SearchText})

OnChange = Collect(
    collectUsers,
    {
        Name: cmb_UserCollection.Selected.DisplayName,
        Email: cmb_UserCollection.Selected.Mail,
        JobTitle: cmb_UserCollection.Selected.JobTitle
    }
)

Where,

  • cmb_UserCollection = Combo box control name
  • collectUsers = Provide the collection name
Power Apps collection using people picker
  • Insert Data table -> Set its Items property to:
collectUsers

Where,

  1. collectUsers = Collection name
Create a Power Apps collection using people picker
  • Save, publish, and close the app. When a user selects users from a combo box control, the selected users’ departments and emails will create a collection, which will be displayed in the data table.
How to create a Power Apps collection using people picker

This is how to create a Power Apps collection using a people picker.

Conclusion

In this Power Apps tutorial, I have explained how to use a Power Apps combo box to search Office 365 users.

Also, I have covered how to exclude guest users from the Power Apps combo box control with Office365Users and how to filter the Power Apps combo box with Office365Users.

Lastly, I have shown you how to assign a default person value for a Power Apps combo box control and how to create a Power Apps collection using a combo box people picker.

You may also like: