IncludedFields property

ResetButton.IncludedFields — { Reference }

Represents the fields that are reset by a reset button. This property is only consulted if the reset button has been instructed to select what fields to reset using a formula.

To set this property, use a formula which returns an array.

Resetting a list of fields

This formula resets Field1, Field2 and Field3:

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

Resetting a range of fields

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 }

Resetting all fields of a form group, screen or the entire app

To reset all fields of a form group or screen, simply write the name of the form group or screen in the formula:

{ FormGroup1, FormScreen1 }{ FormGroup1; FormScreen1 }

This technique can even be used with the app object, to reset all fields in the app. Consider this formula:

IF(ResetAllFields, { App }, { Field1, Field2 })IF(ResetAllFields; { App }; { Field1; Field2 })

The formula above resets all fields in the app if the ResetAllFields switch field has been toggled to its "on" position. Otherwise, it resets only Field1 and Field2.

Resetting fields conditionally with IF

Use IF inside of an array to reset fields based on logical conditions.

This formula unconditionally resets Field1, but Field2 is only reset if the value of Result is greater than 5:

{ Field1, IF(Result > 5, Field2) }{ Field1; IF(Result > 5; Field2) }

Resetting fields conditionally with FILTER

When there are many fields to conditionally reset, using IF is not practical. FILTER takes an array as its first parameter and a logical array as its second parameter with the same number of elements as the first array. Only elements of the first array where the corresponding element of the second array is TRUE are part of the array returned from FILTER.

FILTER({ 1, 2, 3 }, { FALSE, FALSE, TRUE })FILTER({ 1; 2; 3 }; { FALSE; FALSE; TRUE }) returns the array { 3 }{ 3 }, because the elements 1 and 2 are associated with FALSE elements in the second array.

This ResetFields formula uses FILTER to only reset number fields whose values are greater than 3:

FILTER(Field1:Field5, Field1:Field5 > 3)FILTER(Field1:Field5; Field1:Field5 > 3)

This formula only resets invalid fields:

FILTER(Field1:Field5, !(Field1:Field5).Valid)FILTER(Field1:Field5; !(Field1:Field5),Valid)

Examples

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

Makes a reset button reset the fields Field1, Field2 and Field3.

Field1:Field5Field1:Field5

Makes a reset button reset the fields Field1 and Field5, as well as all fields that appear between them.

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

Makes a reset button reset the fields Field1, Field3 and Field5, as well as the fields that appear between Field3 and Field5.

{ FormGroup1, FormScreen1 }{ FormGroup1; FormScreen1 }

Makes a reset button reset all fields that belong to the form group FormGroup1 and the form screen FormScreen1.

IF(ResetAllFields, { App }, { Field1, Field2 })IF(ResetAllFields; { App }; { Field1; Field2 })

Makes a reset button reset all fields in the app if the switch field ResetAllFields is toggled to its "on" position. Otherwise, the fields Field1 and Field2 are reset.

{ Field1, IF(Result > 5, Field2) }{ Field1; IF(Result > 5; Field2) }

Makes a reset button reset Field1 unconditionally and Field2 only if the value of the number field Result is greater than 5.

FILTER(Field1:Field5, Field1:Field5 > 3)FILTER(Field1:Field5; Field1:Field5 > 3)

Makes a reset button reset the fields Field1, Field5 and all fields that appear between them, but only if their values are greater than 3.

FILTER(Field1:Field5, !(Field1:Field5).Valid)FILTER(Field1:Field5; !(Field1:Field5),Valid)

Makes a reset button reset the fields Field1, Field5 and all fields that appear between them, but only if they are invalid.