web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How do I filter Combob...
Power Apps
Answered

How do I filter Combobox to show emails domains when using Office365Users Data Source?

(0) ShareShare
ReportReport
Posted on by

Hi Power App Community,

 

I am trying to set my Combobox which is used to search for Office365 Users to show emails for two specific domains

Domain 1: @wellcome.org

Domain 2: @ippsecretariat.org

 

When I specify one domain it works with no problem but when I try to use a boolean function such as Or, And etc it breaks the combobox but likes the function as it gives no errors?.

 

Here is a screengrab of when it works fine with one domain.

Formula: Filter(Office365Users.SearchUser({searchTerm:ComboBox1.SearchText}),EndsWith(Mail,"@wellcome.org"))

Masum172_1-1685228477773.png

 

Here is when I try to use two domains using a boolean such as Or, And, & which it gives no errors but breaks combo box as doesn't display anything.

Formula: Filter(Office365Users.SearchUser({searchTerm:ComboBox1.SearchText}),EndsWith(Mail,"@wellcome.org"And"ippsecretariat.org"))

Masum172_2-1685228594556.png

 

If someone can kindly assist me with this I would be ever so grateful!

 

Thanks

Categories:
  • Verified answer
    cha_cha Profile Picture
    4,932 Moderator on at

    Hello @Masum172 

     

    You can use a combination of the Nested With function and Ungroup function for this.

    With(
     {
     _domA: Filter(Office365Users.SearchUser({searchTerm:ComboBox1.SearchText}),EndsWith(Mail,"@wellcome.org")) ,
     _domB: Filter(Office365Users.SearchUser({searchTerm:ComboBox1.SearchText}),EndsWith(Mail,"@ippsecretariat.org"))
     },
     With(
     {
     _result: Ungroup(
     Table(
     {res: _domA},
     {res: _domB}
     ),
     "res"
     )
     },
     _result
     )
    
    )

     

    The code above filters user data from two different email domains using the Filter function, combines them into a table using the Table function, and then ungroups the table using the Ungroup function to obtain a single collection of individual records.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard