In this article
1: About the Autosum Element
The Autosum element is an open-ended question type which allows survey participants to enter numeric values in multiple text-boxes and keeps a running total of those values. The sum of all rows or columns is displayed below those input fields and is updated in real-time as the participant enters values.
The following example highlights the Autosum style.
Note: The Autosum element does not accept responses containing decimal values.
2: Adding an Autosum Element Using the Survey Editor
To add an Autosum element using the Survey Editor, first click the "+ Element" button to add a new survey element. Then click "Open End" under Question Types and select the "Autosum" element. Then click "Add".
2.1: Configuring the Element
2.1.1: Basic Settings
In the staging area, add your question and instruction text, as well as the rows and/or column options you would like displayed.
Tip: You can also change the element's style, save it to the Element Library for later use, or preview it in the survey. See Adding and Removing a Question or Element to learn more about adding and editing basic survey elements.
Next, configure the question and response options for the element.
2.1.2: Question Options
The element's question options will appear to the right of the staging area. Click the question or instruction text to set rules for the element using the available options.
- Label: The default question label, automatically assigned by the Survey Editor. Click the label to change its value.
- Show If: The logic condition for the element (by default, elements are shown to all participants). Click to create new logic conditions or to select an existing logic condition from the list. For more information on adding logic to survey elements, see Adding Logic to a Question or Response Option.
- Languages: The language version for which the element is shown (by default, elements are shown to all language versions). Click to select the versions for which the element will be shown .
- Mandatory: The question is mandatory and participants will be unable to continue the survey without completing it. Check the box to force participants to provide a response to the element.
- Randomize: Show answer options in random order. Check the boxes for rows, columns, and/or groups to randomize them.
- Allow Decimals: The Autosum element does not accept responses containing decimal values. Checking the box will trigger an incompatibility warning.
- Value Range: Responses to answer options must fall within an acceptable range. Enter start and end numbers to assign a value range for each open-ended number field in the question. For example, entering "1-200" will allow the participant to only enter numbers from 1 to 200 in each open-ended response option.
- Validate Sum: Responses to grouped answer options must add up to an acceptable total. This option is only available if the question has both rows and columns. Enter a value to force the numeric sum of each row or column (based on what the question is "grouped by") to be exactly equal to this value.
- More Options: Additional question options. Use the drop-down menu to select and specify settings for less commonly used options. For more information on the available options, see More Options - Advanced Features.
2.1.3: Response Options
Settings for the element's row and column response options will also appear to the right of the staging area. Click a row or column text-box to set options for that specific response.
- Label: The default response option label, automatically assigned to the row or column by the Survey Editor. Click the label to change its value.
- Data Value: The value to display for the response option in the data. If available, click into the box to edit the default value for the row or column.
- Show If: The logic condition for the response option (by default, options are shown to all participants). Click to create new logic conditions or to select an existing logic condition for the row or column. For more information on adding logic to response options, see Adding Logic to a Question or Response Option.
- Languages: The language version for which the response option is shown (by default, options are shown to all language versions). Click to select the language versions for which the row or column will be shown.
- Do Not Randomize: This option is only available if the "Randomize" general option is selected. Check the box to force the response option to remain stationary.
- Optional: This option is only available if the "Mandatory" general option is selected. Check the box to allow the row or column to be optional.
- Open End*: Allow participants to enter an open-ended response to the row or column. Select either "mandatory" or "optional" from the drop-down to configure the behavior of the open-end response box. "Mandatory" means the participant must enter feedback in the response box for the row or column they have selected, while "optional" means that feedback is not required.
- Hidden: Hide the response option from participants. Check the box to hide the row or column in the survey. Hidden response options still appear in survey reports and data.
- No Answer*: Allow participants to skip answering the row or column. Check the box to replace the open-end number box with an exclusive checkbox form. This option is primarily used for "Don't know" or "None of these" response options.
- Value Range*: Participants’ responses to the row or column must fall within an acceptable range Enter start and end numbers to assign a value range for the open-ended number field. For example, entering "1-200" will allow the participant to only enter numbers from 1 to 200 in the open-ended number field.
- Validate Sum: Participants’ responses to grouped answer options must add up to an acceptable total. This option is only available if the general option "group by" is set to rows or columns. Enter a value to force participants to enter a number equal to or less than that number.
- Form Pre-Text*: Text/symbol that appears before the answer field. Click into the box to enter a value.
- Form Post-Text*: Text/symbol that appears after the answer field. Click into the box to enter a value.
- More Options: Additional question options. Use the drop-down to select and specify settings for less commonly used options. For more information on the available options, see More Options - Advanced Features.
Note: The options marked with an asterisk (*) are only available for rows and will not appear in the response options for columns.
Once you are satisfied with your question and response option settings, the Autosum is ready to use.
Tip: If desired, you can preview the element at any time by clicking the "Preview" link located at the top right corner of the element in the staging area. To learn more about previewing an element, see Previewing a Question.
4: Adding an Autosum Element Using the XML
To add an Autosum element using the survey XML, start by adding a “Number” question where you would like the Autosum to appear.
Then, apply the Autosum question style by adding uses="autosum.6" to the question tag.
4.1: Customization
The following customization options can be used to modify the Autosum’s question style in the survey XML.
| Attribute | Type | Description |
|---|---|---|
autosum:preText |
String |
The text or symbols appearing to the left side of the answer field. Can be applied on row or column tags (depending on grouping). Default: [blank] Example: |
autosum:postText |
String |
The text or symbols appearing to the right side of the answer field. Can be applied on row or column tags (depending on grouping). Default: [blank] Example: |
autosum:sumPreText |
String |
The text that appears to the left side of the sum indicator. Can be applied on row or column tags (depending on grouping). Default: Example: |
autosum:color |
String |
The color of the Autosum indicator when the sum does not meet the required amount. Enter either a hex color code or valid CSS color name. Can be applied on row or column tags (depending on grouping). Default: Example: |
autosum:prefill |
String |
The number with which the answer fields are pre-filled. Can be applied on row or column tags (depending on grouping). Default: [blank] Example: |
autosum:showRemaining |
Bool |
When using Default: Note: Requires that the "validate sum" option be set in the Survey Editor question options menu or that |
autosum:legendPosition |
String |
The position of the autosum legend in the answer grid. Options include "top" or "bottom". Default: Note: Requires grouping by column ( |
autosum:disabled |
Bool |
Disable summing for a particular column, row or question (depends on grouping). Default: |
autosum:amount |
String |
The threshold the amount must be enough to return Default: Note: This option can be used to force the sum to match the sum of a previous question. |