"" for Text variables
0 for Number variables
1 JAN 1800 for Date variables
FALSE for True/False variables
"" for Multiple Choice variablesFunction name | VALUE |
VALUE | VALUE ( v:VAR, default: ) |
Parameters | This function requires you to replace two parameters: |
v: VAR |
The function returns the value the user gives to a variable and returns a default value if the user has not answered it. |
default |
The function returns the value the user gives to a variable and returns a default value if the user has not answered it. |
Result | A date, number, text, or true/false value. |
In the following example, suppose you need to calculate a total. However, one of the variables in the calculation, Sales Tax, may not be required. Since the variable may be left unanswered, you can use the VALUE function to assign a default value.
Services Cost + Product Cost + VALUE( Sales Tax )
In the above script, the value returned for VALUE( Sales Tax) is zero if unanswered because there was no default specified and the default for a number variable is zero.
Services Cost + Product Cost + VALUE( Sales Tax, 10 )
In this script, the VALUE ( Sales Tax, 10) would return 10 if unanswered.
After you download the example template, you can import the template to any workspace to see this example code in action.