I am a freshman in power apps using (level 0). I have an issue with writing a formula for my editable form.
What I want from the formula: as soon as the user successfully submitted the form there should be 1) notification pop up about successful submission 2) the user should see emptied form (with blank fields or fields with default data) thus the form should be reset immediately after submission.
This is a very common and essential feature to build into any Power App, so it's a great thing to learn as you're starting out. Getting that user feedback and smooth flow is key to a good app.
To achieve what you're looking for—showing a success notification and resetting the form immediately after submission—you'll want to use a combination of the OnSelect property of your button and the OnSuccess property of your form. This is the most reliable way to ensure the form only resets after the data has been successfully saved.
Here is a step-by-step guide to set it up.
Step 1: Configure Your Submit Button
First, you need to tell your button to submit the data from your form.
Select the Button control that you want the user to press for submission.
Go to its OnSelect property in the formula bar.
Enter the following formula. Replace YourFormName with the actual name of your form control (e.g., Form1).
SubmitForm(YourFormName)
This command will take all the information the user entered and send it to your data source (like a SharePoint list or Dataverse table).
Step 2: Set Up the Actions for a Successful Submission
Next, you need to define what happens after the submission is successful. This is where you'll add the notification and the form reset.
Select the Form control itself, not the button.
From the properties dropdown menu (usually on the top-left of the screen), select the OnSuccess property.
Enter the following formula in the formula bar. Again, replace YourFormName with the name of your form.
Notify("Submission successful!", NotificationType.Success): This function displays a green pop-up banner at the top of the screen with your message, letting the user know everything worked correctly.
; (semicolon): This is a formula separator in Power Apps, allowing you to run multiple commands in sequence.
ResetForm(YourFormName): This function clears all the user's input from the form and sets the fields back to their default values, making it ready for a new entry.
By placing these actions in the OnSuccess property, you guarantee that the notification and reset will only happen if the data was saved without any errors.
That's it! When a user now fills out the form and clicks your submit button, the data will be sent, and upon successful completion, they will see the success message and the form will be cleared for the next use.
Hope this helps you in your Power Apps journey!
Regards,
Jerald Felix
1 people found this reply helpful.
Was this reply helpful?YesNo
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.