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?
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.
Hey I think i got something that could help you :
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.
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.
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?
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional