Hi @Kubo :
The second formula you provided has a syntax error, SearchUser does not allow you to search in this way.
If you need to user gallery to select the search field,please try:
1\Add a Gallery control(Gallery1) and set it's items property to
["Email","Displayname"]
2\Add an other gallery and set it's items property to:
With(
{UserList: Office365Users.SearchUser({searchTerm:TextInput1.Text,top:999})},
Switch(
Gallery1.Selected.Value,
"Email",
Filter(
UserList,
TextInput1.Text in Mail
),
"Displayname",
Filter(
UserList,
TextInput1.Text in DisplayName
)
)
)

Best Regards,
Bof