Configuring Question Calculation Fields in a Form
This Feature lets you Calculate Questions and Responses in Forms
The steps provided in the article can only be performed by a CMO Application administrator as the settings are made within the Admin module.
Begin by logging into the CMO Application and go to the Admin module.
Go to Forms.
Go to the Draft version of the required Form.
Go to the required Section.
Select the Question for which the calculation field is required.
In the Response Text select the required text type.
In the 'Default tab' field select the required tab as Default. (In the below example, the Attachment tab is selected as default for the Question).
The Default tab shows what tab of the question will be opened by default in the perform window.
The Default tab displays what will be opened by default. In this instance “Question”.
In the Test calculation response, answer_1 does not contain a numeric value.
Click Save to save the changes.
How to Create the Answer (full configuration for calculation field response type)
To create the calculation response perform the following steps:
1. In the Response tab click on the Add button
2. The Create Answer dialog opens.
3. Select Calculated field from the drop down Response Type menu.
4. Enter a Response Type description in the Response Text field
5. In the Expression window enter the expression you want the perform event to calculate.
6. Select Validate to check the expression entered is correct.
7. Click Save to keep the inputs and return to the Response tab.
The Response tab displays the answers used in the Expression field in the Calculation field response.
Navigate back to the Form page (Click on Back to section and then Back to form button) and publish the template by clicking on the Publish form link. This is required to create the event in this form.
How the Answer is used
1. Navigate to the Event List
2. Click on the New button.
3. In the New dialog, enter the mandatory fields (Indicated with a * asterisk).
4. In the Form select the template.
5. Click Save and Perform at the bottom of the dialogue
In the “Calculation answer if logic tab” enter data to the answers which are used in the calculate response. The Calculation answer shows the calculated result. In this example the answer is OK.
In this example the Calculation answer is Fail.
About the Ternary Operator
The conditional operator, also known as the ternary conditional operator, evaluates a Boolean expression and returns the result of one of the two expressions, depending on whether the Boolean expression evaluates to true or false.