ResetForm

How to Use the Power Fx ResetForm  Function in Power Apps

Understanding the Power Fx ResetForm Function

The Power Fx ResetForm function is a powerful tool that can be used to reset a form to its original state. This function can be used in conjunction with other Power Fx functions to create a seamless user experience.

When the ResetForm function is called, it clears all the user inputs of a form. It does not, however, clear any default values that were set when the form was created. This means that if you have set default values for certain fields in the form, those values will not be cleared when the ResetForm function is called.

How to Use the Power Fx ResetForm Function

Using the Power Fx ResetForm function is very simple. You just need to follow these steps:

1. Open the form that you want to reset in Power Apps.

2. Click on the button or icon that you want to use to reset the form. This could be a “Reset” button or an icon that resembles a refresh button.

3. In the “OnSelect” property of the button or icon, add the following code:


ResetForm(Form1)


Replace "Form1" with the name of the form that you want to reset.

4. Save and publish the app.

Now, when the user clicks on the button or icon, the ResetForm function will be called, and all the user inputs of the form will be cleared.

Advanced Usage of the Power Fx ResetForm Function

The Power Fx ResetForm function can be used in a variety of ways to create more complex forms. Here are some advanced use cases for the ResetForm function:

Reset Multiple Forms

You can use the ResetForm function to reset multiple forms at the same time. To do this, you just need to call the ResetForm function for each form that you want to reset. Here's an example:


ResetForm(Form1);

ResetForm(Form2);

ResetForm(Form3)


Reset Specific Fields

You can use the ResetForm function to reset specific fields in a form. To do this, you just need to specify the name of the field that you want to reset. Here's an example:


ResetForm(Form1);

UpdateContext({TextInput1: “”})


This code would reset the form and clear the value of the "TextInput1" field.

Reset a Form After Submitting it

You can use the ResetForm function to reset a form after it has been submitted. To do this, you just need to add the ResetForm function to the "OnSuccess" property of the form's data source. Here's an example:


SubmitForm(Form1);

ResetForm(Form1)


This code would submit the form and then reset it to its default values.

The Power Fx ResetForm function is a simple but powerful tool that can be used to reset a form to its original state. It can be used in many different ways to create more complex forms. By using the ResetForm function in your Power Apps, you can create a better user experience and make your forms more efficient.

Power Apps Training Courses by G Com Solutions (0800 998 9248)