Showing results for 
Search instead for 
Did you mean: 
Advocate III
Advocate III

Run search when press enter

Hi all - I've found a similar question on here, but not the same.  I'm brand new to Power Apps and am trying the Org Browser example template.  Two questions please:

  1. How do I get the search from the front screen to run when a user presses the Enter key (rather than having to click on the search icon with their mouse)?; and
  2. How do I get it so when someone clicks on an email address, it launches their email client and creates an email?  In PowerApps I'm seeing an 'The function 'First' has some invalid arguments" error against the default code: Launch("mailto:"&First(EmployeeProfile).Mail).

Hope you can help and thanks in advance.  Oz


@Meneghino wrote:

Hi @Oz


Glad that you are now finding your way around.  As you can see from the OnSelect proerty of the search icon, what it does is to:

1) Load the search term into a collection called "SearchUser"

2) Navigate to the SearchScreen where the results are displayed


One alternative is to place the code that is in the OnSelect of the search icon in the OnChange property of the text input, but the problem is that it will probably be triggered every time a user enters a letter.


The solution I would suggest, if this can work, is to place the text input in the same screen as the gallery.


Then you can simply use this as the Items property of the gallery:



If(Len(TextInputSearchEmployee.Text) > 0, Sort(Filter(Office365Users.SearchUser({searchTerm:TextInputSearchEmployee.Text}), Len(GivenName) > 0), GivenName, Ascending))


If you decide to name the text input something else, then just substitute that name for TextInputSearchEmployee


I am suggesting this so that you avoid the navigation step, which is why a search icon is necessary.


If performance is bad, then you can try to set the DelayOutput property of the text input to true or false.  If false then it will search as soon as any change is made to the text, but may make the app hang a bit.  If true then it will wait, so that it will not search immediately but will hang less.


Hope this helps.


Any chance there is another workaround to use the front-facing search box and have the key enter or return start the search off?  Considering we want to push this out to mobile users sometimes it gets covered by the keyboard.  To combat the covered issue, I moved it up and added a label for them to click the magnifying glass after entering their text.

Perhaps the use of Rules?  I am using rules to highlight the text and change the button color, just to help nudge them forward.


Thank you for any input, very new to this but loving the concept so far.

Helpful resources


Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users


We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (24,338)