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"))
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"))
If someone can kindly assist me with this I would be ever so grateful!
Thanks
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.