Feature: More customizable reset buttons

Use a formula to determine which fields are reset by a reset button. These buttons can now assign blank values to fields.

Reset buttons were added to Calcapp years ago and have changed little since. You have been limited to either resetting all fields of the current screen or resetting all fields of the app. Also, resetting a field has always meant restoring its value to its initial value, never to a blank value.

Today, reset buttons finally become more customizable.

The IncludedFields property

Like email and download buttons, reset buttons now support the IncludedFields property, which you can set through a formula. For a reset button, this property determines which fields to reset.

In order for the formula to be picked up by Calcapp, you must configure your button to determine what fields to reset using a formula. Choose Select fields using formula from the drop-down menu in the inspector when your button is selected, and then on the fx button next to Included fields to edit the formula:

The inspector, showing the options for reset buttons

For instance, to reset Field1, Field2 and Field3, associate the following formula with the IncludedFields property:

{ Field1, Field2, Field3 }{ Field1; Field2; Field3 }

Ranges enable a large number of fields to be referenced in a compact way. This formula resets the fields Field1 and Field5, as well as all fields that appear between them:

Field1:Field5Field1:Field5

This formula resets Field1, Field3 and Field5, as well as the fields that appear between Field3 and Field5:

{ Field1, Field3:Field5 }{ Field1; Field3:Field5 }

You can also reset all fields of a screen simply by referencing the screen in the array, reset all fields of your app by referencing the App object and conditionally reset fields using IF. You can even reference all fields of a screen, and only reset those whose values are greater than 5 (say) using the FILTER function.

For more on how to use the IncludedFields property, including lots of examples, refer to our newly-expanded property documentation.

Resetting fields to blank values

What does it mean to reset a field? Up until today, it has meant setting its value to the same value the field had when it was first shown. If no initial value has been assigned, that is a blank value.

Many app authors found it puzzling to see the value revert to a prior value when the field was reset, though. Instead, they expected fields to lose their values, that is, be assigned blank values.

That behavior can now be realized by selecting Assign blank value in the inspector. The default remains Assign initial value.

« Feature: Download and start large apps faster Feature: More options for CSV and TSV files »