Hello,
I have a combobox with its Items property set to the below. The DisplayName property within AAD is in the format of Surname, GivenName, which means users have to search according to that format (i.e., "Doe, John").
This is why I created the FullName property in the Filter function below, such that users could search in a more natural way (GivenName + a space + Surname).
I have the Search Fields property set to ["FullName"] and have confirmed (via setting the DisplayFields property to ["FullName"]) that the FullName value is correct - i.e., "John Doe".
However, if a user enters a space after the GivenName in the combobox's search string, the search breaks. I.e., if they search "John", all the Johns appear as expected. As soon as they enter a space to begin the last name, all results that were returned with "John" disappear.
I have experimented with trimming the searchTerm value in the SearchUserV2 function, but this just makes it so the results disappear on the first character of the Surname as opposed to the space.
Why is the search behaving like that?
Filter(
SortByColumns(
AddColumns(
AddColumns(
Office365Users.SearchUserV2(
{
searchTerm: Self.SearchText,
isSearchTermRequired: false
}
).value,
"UserDisplayData",
Concatenate(
ThisRecord.GivenName,
" ",
ThisRecord.Surname,
" | ",
ThisRecord.JobTitle
)
),
"FullName",
Concatenate(
ThisRecord.GivenName,
" ",
ThisRecord.Surname
)
),
"Surname"
),
AccountEnabled = true && Not("#EXT" in UserPrincipalName) && Not("(External Vendor)" in UserPrincipalName) && Not(IsBlank(GivenName))
)