web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to trigger an acti...
Power Apps
Unanswered

How to trigger an action when Enter key is pressed in a TextBox

(0) ShareShare
ReportReport
Posted on by

Hello everyone, 

I got a TextBox and i want to Patch() this value when I click on the Enter key while I'm on the TextBox.

For the moment the Patch() function occur when I click on the button "Retirer" below. But is it possible to do it when clicking on the Enter key ? I can't find this property on the text box, it would be like a OnKeyPress property but it doesn't seems to exist on Power Apps. 

I know that there is OnSelect and OnChange option but I don't like it because it trigger the Patch() function while am writing on the Textbox or when I'm selecting it. 
Noah9806_0-1677077602896.png
Does anyone have a solution for this ? 


Thank's in advance for your help

Noah

 

Categories:
I have the same question (0)
  • MJ84 Profile Picture
    263 on at

    On change property should work for you --- the onchange is only actioned after the user has changed the text input and then tabbed, entered or clicked out of the textinput box

  • Community Power Platform Member Profile Picture
    on at

    Thank's for your response, but personnaly, the OnChange property is actionned when I finish to write something, without any tabbed, entered or clicked out of the TextInput Box. And that's why it's a problem for me 

  • MJ84 Profile Picture
    263 on at

    That's strange it's never behaved that way for me

     

    The only real alternative I think is to have a submit button that patches the input box when clicked.

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    Oh yes I understand the problem now, I was using a TextBox which behave differently than an TextInputBox. That work fine now with the OnChange Property. Thank's for having Helping me indirectly  ! 

  • MJ84 Profile Picture
    263 on at

    yes sorry you referred to textinput in your first post so assumed you were talking about a textinput box 🙂

     

    Glad I could help indirectly if you can mark as solved 🙂 thanks 

  • Motion Profile Picture
    69 on at

    check out this community solution too

    Solved: Submit Form with the Enter Key - Power Platform Community (microsoft.com)


  • abc 123 Profile Picture
    784 Moderator on at

    For anyone else looking, there is no way to create Custom keyboard shortcuts. This link is only for the existing shortcuts built into the app.

  • CU15091556-0 Profile Picture
    49 on at
    The solution that seems to be working for me is to instruct your users to use the tab button instead of enter.
     
    Select your button in the OnChange property of the text input.  It won't fire until you move the focus away from the text input, which the tab button will accomplish.  In the OnSelect property of the button, do whatever you need to do with the text; reset the text inbox if needed to clear it or prepare it for the next use.  If you need to cursor to come back to the text box, use SetFocus to bring it back to the text input field.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard