Skip to content
Home » Reset multiple control values in Power Apps

Reset multiple control values in Power Apps

In Power Apps, resetting multiple control values can be achieved using the Power Apps in-built function Reset for each control you want to reset.

The Reset function in Power Apps is used to reset a control back to its default value. When you reset a control, it will return to the value defined in its Default property.




Reset multiple control values

Let’s say, If you want to reset text input fields txtName, txtAge, and txtGender , you need to use the following code on button OnSelect property.

Reset(txtName);
Reset(txtAge);
Reset(txtGender);

Now, when you click the Reset button, it will reset the values of all the controls.

Reset multiple control using Variables

As demonstrated in the previous example, we need to write the Reset function for each control individually. However, by using either a global or context variable, we can avoid writing the same Reset function repeatedly for each control.



To do this, select the Reset button, go to its OnSelect property, and set a variable varReset to false, followed by true.

Set(varReset, false);
Set(varReset, true);

 

Now, select each control individually and set its Reset property to varReset.

 

Reset Form controls

To reset all control values in a form back to their default states, you can use the ResetForm function.




 

Recommened for you

Power Apps Tutorials

Submit mulitple records in Power Apps

Loading

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SQL BI Tutorials

Subscribe now to keep reading and get access to the full archive.

Continue reading