Dynamic Value
Last updated
Was this helpful?
Last updated
Was this helpful?
To give a field a default answer, multiple options are available. Also multiple default values are supported, which can be concatenated into 1 default answer. This can be configured under the section Translations: Label & Default answer & help text.
Default answer : Select what kind of default answer should be displayed
Fixed Value: When this option is set, the field always contains the same default answer that is defined in free text
Person field : Select this option when user data should be used as default answer. User variables can be edited in the Admin | Adapter menu.
Form field : Use this option when the default answer should be derived from another question. The first drop down list, shows all fields of the current form that show DataStore Parameters (selection fields). In the second drop down list, the column from the parameter can be selected. In the example below, the default answer is the Name of the Group chosen in the earlier question "Select Group":
Main/Sub-Form field: Use this option when the default answer is provided by another form than the current form. This may occur when sub forms are used.
Process Instance Variable: Use this option when a form is used in a process as an external form. The variable is listed as <variable name>(<process name>)
Repeatable section index : when using repeated sections, you might want to know the sequence number of that section. use this option to implement it in your form (for example to show the number of entries).
Calculation Fields
SSP allows to make basic calculations, using default values. If you want for example to sum up 2 values, entered previously in the form in 2 other Fields, you can make that using calculation fields. You can make complex calculations by using brackets.
To activate the calculation engine, first check the field : 'Dynamic value contains calculations':
The second checkbox allows to hide calculation errors for end user.
For example, if you want the sum of 2 fields that are in text fields:
As long as the 2 Fields are not filled in, the calculation can not be made. This will result in an error message on-screen:
When the option 'Hide calculation info from user' is checked, the errors will no longer appear.
Supported Operators and examples of calculation fields.
Supported operatorse: +, -, *, /
These operators have been extended and continue to. We refer to the WIki for more information & examples on Calculations in Forms: http://wiki3.smt-x.com/index.php?title=FormTips
To avoid issues, you can choose to replace an empty value by set value, as shown in this example: use : ToNumber('#field reference here#',0), Example:
ToNumber('#REPLACE-FORMFIELD-Numbers example||number1||#',0) + #REPLACE-FORMFIELD-Numbers example||number 2||#
In this case, the first value is replaced by '0', as long as nothing is entered in the source field called 'number1'.
Examples:
•
Format('{0:F2}',#REPLACE-FORMFIELD-Numbers example||sum||#) -> result : 5.00
•
Format('{0:F5}',#REPLACE-FORMFIELD-Numbers example||sum||#) -> result : 5.0000
You can also set the number of digits after the separator, using : Format('{0:Fx}, <<value here >> ), where Fx stands for the number of values behind the comma-separator.