A few weeks before, I developed a Power Apps application. After using that, many users expected to submit the data by pressing the Enter key on the keyboard. Although this feature isn’t available by default in Power Apps but it can be set up with simple steps.
In this article, I will explain how to trigger an action when the Enter key is pressed in Power Apps with a simple example.
Submit Form in Power Apps Using the Enter Key
Look at the leave request form below; after filling in all the details in the Power Apps form, I press the Enter key on the keyboard, and it automatically submits the form details.
The SharePoint list [Employee Leave Requests] stores details entered in the Power Apps form.
Follow the steps below to achieve this!
1. Connect the SharePoint list with the Power Apps application by clicking the +Add datasource under the Data section.
2. Add an Edit form control from the + Insert tab and provide the connected SharePoint list name on its DataSource property.
'Employee Leave Requests'
3. Add a button control to submit the form details and provide the below formula on its OnSelect property.
SubmitForm(frm_EmpLeave);
NewForm(frm_EmpLeave);
The SubmitForm() function will submit the Power Apps form data to the SharePoint list. After submitting the form to make it a new form again, I used the NewForm() function.
4. To achieve the enter key functionality for submitting the Power Apps form, add the below code in the OnChange property of the last field present in the Power Apps form control.
Note: Power Apps has no direct functionality that identifies the Enter key press on the keyboard, so the formula below will implicitly call the button control’s Select property after entering the data and pressing the Enter Key.
Select(btn_Submit)
btn_Submit is the button control name.
5. Save the changes and publish the application. While previewing, fill in the Power Apps form details, make sure your cursor is on the last field in the form, and click on the Enter key. It calls the formula on the button control OnSelect property and submits the form data to the SharePoint list, as shown in the image below.
This is one approach to achieve the submit form data by clicking the Enter key in Power Apps.
I hope you understand how to submit Power Apps form data by clicking the Enter key on the keyboard. I have explained how to achieve this with simple steps! Follow this article if you’re also trying to fulfill this requirement.
Also, you may like:
- Power Apps show/hide fields based on dropdown selection
- Power Apps uncheck the check box when another is checked
- Power Apps Modern Form Control – How to Use
- Power Apps Modern Information Button Control [Complete Guide]
- Concatenate Power Apps Combo Box Value With a Custom Value?
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com