Reset Variables

The Reset Variables action is used to reset variables to their default values, as defined in their variable definitions.

This table describes the parameters for the Reset Variables action:

Parameter Name Description
variables

An array of variables. Here is an example:

["$page.variables.var1", "$page.variables.var2"]

Note:

If a single variable expression is provided instead of an array, it is implicitly treated as an array of one variable.
Each expression in the array has to resolve to a variable or variable property, and variables must be prefixed with their scope:
  • $application.variables
  • $page.variables
  • $chain.variables
Each expression should be followed by a variable name or a path to a variable property. For example:
  • $application.variables.a
  • $page.variables.a.b
  • $variables.a.b.c (which is shorthand for $chain.variables.a.b.c)

Here's an example of a call to the Reset Variables action, in which two variables are to be reset:

     await Actions.resetVariables(context, {
        variables: [
          '$page.variables.firstNum_pv',
          '$page.variables.secondNum_pv',
        ],
      }, { id: 'resetFirstAndSecondNum' });