HotDocs Models: value( var, expression )

Placeholder Replace With
var The name of a variable
expression (optional) The specific value you want to assign to the variable if the user leaves it unanswered. Otherwise, HotDocs will use one of the following default values:
"" for Text variables
0 for Number variables
1 JAN 1800 for Date variables
FALSE for True/False variables
"" for Multiple Choice variables

This expression returns a default value for the variable type if the variable is unanswered. If the variable is answered, the value is the answer the user specifies.

For example, users will sometimes purposely not answer a question in the interview. However, all variables must be answered or the script will fail. Using value assigns an answer (albeit a default one) so that the script or expression can be processed correctly and still return a value.

In the following example, suppose you need to calculate a sum. However, one of the variables in the calculation, SalesTax, may not be required in order to produce the result. Since the variable may be left unanswered, you can use the value expression to assign a default value of 0 to the variable so that the script can be processed correctly.

The optional expression placeholder allows you specify the value that should be returned if the user leaves the question unanswered. Otherwise, HotDocs will use the default value, shown in the table, above.

ServicesCost + ProductCost + value( SalesTax )