cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
_sourcecod3_
Helper IV
Helper IV

O365 search user by both name and email

Hi all,

Been doing research and trying to figure out if there is a way to search for user using name or email in a combobox. So if someone wants to search using an email address they can or if they want to search using name. 

 

Not sure if this is even possible. 

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@_sourcecod3_ 

<Palm smack to head!>  My bad...typo in the formula.  Should be:

AddColumns(Office365Users.SearchUserV2({searchTerm:Self.SearchText}).value, "_searchField", DisplayName & " " & Mail)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
RandyHayes
Super User
Super User

@_sourcecod3_ 

Yes, you will need to define the search field though.  This is done in the Items property of the combobox.

So, the following formula on the Items will provide what you need:

AddColumns(Office365Users.SearchUserV2({searchTerm:Self.SearchText}).value, "_searchField", DisplayName & " " & Email)

Then set your search field for the Combobox to: _searchField.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

HI @RandyHayes thanks for your reply. I tested this and it's only searching for displayname, but when try by email nothing shows up. I'm I missing something?

 

Thanks

RandyHayes
Super User
Super User

@_sourcecod3_ 

<Palm smack to head!>  My bad...typo in the formula.  Should be:

AddColumns(Office365Users.SearchUserV2({searchTerm:Self.SearchText}).value, "_searchField", DisplayName & " " & Mail)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes lol - <Palm smack to head!> me too, I should've known this since it's pulling it from the Office365Users. 

 

It's working now Randy, thanks for your help. 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,485)