While testing a Power Apps Survey form, I noticed an issue where the Person combo box control allows users to select external guests (from Office 365 AD) when submitting the form. And then I realised that it’s not the correct approach, where someone can accidentally pick any guest user and submit the form.
To overcome this issue, we need to display the internal user names (excluding guest users) from the Office 365 Active Directory in the Power Apps Combo box.
In this article, I will show you the various ways to remove guest users from Power Apps Combo box control. Additionally, we will discuss how to remove external guests and display only active users in a Power Apps Combo box control with examples.
Remove Guest Users From Power Apps Combo box
In the screenshot below, you can see in the first image how all Office 365 users, including external guest users, are displayed. After removing all guest users from the combo box, it displays only internal user names, as shown in the second image.

So let’s get started!
I have the SharePoint list below (Employee Survey Form) that contains various columns with different data types. Additionally, there is a Person field called Employee Full Name.

In Power Apps, there is a Modern Edit form that contains all these fields, along with the person column (Employee Full Name).

Earlier, I provided the code below (in the Combobox Item’s property), which allows us to see all Office 365 users in the combo box control.
Office365Users.SearchUser({searchTerm: DataCardValue9.SearchText})
After that, when I previewed the app and expanded the combo box, it displayed all the Office 365 users, including the external guest user names.

Now I would like to remove all external guest users and display only internal users in the Combo box control.
To do this, follow the different approaches below:
Formula – 1: [Filter out Guest users]
Most guest users contain #ext# in their UserPrincipalName. We can filter those out by using the code below: (apply this code to the Employee full name Combobox datacard Items property)
Filter(
Office365Users.SearchUser({Top: 200}),
Not(
"#ext#" in Lower(
Coalesce(
UserPrincipalName,
Mail,
""
)
)
)
)
Now, if you preview the app and expand the combobox, it won’t show any guest users.
Formula – 2: [Improve Performance with Collections]
The best practice is to use a Power Apps Collection. We can filter the external users inside a collection and then bind the collection to the Combo box control.
Apply the code below either on the App’s OnStart property and the Screen’s OnVisible property:
ClearCollect(
colInternalUsers,
Filter(
Office365Users.SearchUser({Top: 200}),
Not("#ext#" in Lower(Coalesce(UserPrincipalName, Mail, "")))
)
);colInternalUsers = Collection name

Next, select the Employee name Combo box data card value and bind its Items property to the collection, i.e., colInternalUsers.

Finally, refresh the app, and you can see all the external guest users have been removed from the Power Apps Combobox control.
Formula – 3: [Remove Office 365 Guest Users & Show Only Active Internal Users]
In some cases, after removing guest users from the Power Apps Combo box, it still displays all internal Office 365 users, including inactive ones.
I would now like to filter the list further so that the Combo box shows only active internal users, excluding both guest and inactive accounts.
To achieve it, set the code below on the Combo box Datacard’s Items property:
Filter(
Office365Users.SearchUser(
{
searchTerm: DataCardValue9.SearchText,
top: 999
}
),
AccountEnabled = true && Not("#ext#" in Lower(UserPrincipalName))
)Where,
AccountEnabled helps to retrieve all the active users from Office 365.

Once you preview the app and expand the Combo box, it will only show the active internal Office 365 users.
I hope this article helped you understand how to remove Office 365 guest users from the Power Apps Combo box control, along with various examples.
Also, you may like some more Power Apps tutorials:
- Power Apps Bulk Approvals Using Power Automate
- Display “Time Ago” Labels in Power Apps
- The Reset function can only be used with a resettable control
- Populate Distinct Values in Power Apps Combo Box
- Validate Power Apps Combo Box Control

Preeti Sahu is an expert in Power Apps and has over six years of experience working with SharePoint Online and the Power Platform. She is the co-author of Microsoft Power Platform: A Deep Dive book. As a Power Platform developer, she has worked on developing various tools using Power Apps and Power Automate. She also makes Microsoft 365 videos and shares them on YouTube.