Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Search when pressing ENTER key

(0) ShareShare
ReportReport
Posted on by

Hello!

 

I have made a PowerApp with a simple text input field and a button. When pressing the button, I am making an API call, searching for what I have just written. The app works well, but I find myself, and the people that have tested it, to instinctively press ENTER when we have written what we want to search for. At the moment, that does absolutely nothing.

 

I would like to add functionality so that pressing the ENTER key actually performs a search, similar to the Search button.

 

My research has made me try slider OnChange events and Text Input OnChange events to select the button, but that always makes it search every time I input anything into the text input, and I don't want that.

 

Is it possible to do an action when pressing ENTER?

Categories:
  • Hagru Profile Picture
    on at
    Re: Search when pressing ENTER key

    Hello @DBO_DV!

     

    It still won't trigger when pressing Enter, but it will delay it enough before doing the OnChange to make it feel like the Enter button is clicked. I will just add a check to see if the text field is empty, and if it's not, it can just search using the OnChange with a slight delay.

     

    I'll mark it as a solution as it got me one step closer to what I wanted, and it's sufficient in my case.

  • Verified answer
    DBO_DV Profile Picture
    4,530 Super User 2025 Season 1 on at
    Re: Search when pressing ENTER key

    Hey I think i got something that could help you : 

    DBO_DV_0-1718801569362.png

    you need to set this to true and use on change with this. instead of using Select(ButtonName) you could also just add  the formula there. 

     

    Let me know how it works.

     

  • Hagru Profile Picture
    on at
    Re: Search when pressing ENTER key

    Hi @DBO_DV 

    The reason why it did not work for me with OnChange: Select(ButtonName) is because it would basically click the button for every letter I typed. Meaning that when I wrote a name let's say it had 8 letters, it would make 8 different API calls, and it would cause errors when erasing everything. 

     

    The search field felt normal, and I did not have to click it again after every letter or something like that, but it would make an API call for literally every change in the text field, not just when I changed focus away from it.

  • DBO_DV Profile Picture
    4,530 Super User 2025 Season 1 on at
    Re: Search when pressing ENTER key

    Onchange would be the only option you have there. Could you explain why it didn't work? 

    Onchange should only get triggered when you remove the focus from your text input. 

    Do you find yourself writting in the searchbar without wanting to search for something new?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard