Element decorators provide additional information or rules that tell the software how to manage or interpret list elements or question options. They can control display settings, influence respondent flow, store custom data, create "other specify" fields, and more.
Element decorators are defined with curly braces and text and are placed after a list element or question option.
1. What best describes your employment status?
type: radio
1. Full-time
2. Part-time
3. Self-employed
4. Retired {if $QAGE >= 45}
5. Student
6. Unemployed, looking for work
7. Unemployed, not looking for work
97. Other {autoother: y} {desc: Other}
Decorators can also be used as column headers in spreadsheets.
Common element decorators
The table below lists commonly used decorators.
Decorator name | Description | Common formats |
anchor |
Keeps the option fixed in its original position. It must be used with the In r9+, it is no longer needed for "Other" and "Exclusive" options, as they are anchored by default. |
{anchor: y} |
autoother |
Creates an "Other (specify)" option that gives respondents the opportunity to write in a response. Additional parameters are available to modify the text field's size, placeholder, datatype, etc. |
{autoother: y} |
collection |
Assigns a list item to a different collection. | {collection: 100} |
collection header |
For r9+; when placed next to a list item, it turns the option into a header for a collection of items in the list, much like a category label. | {collection header: y} |
comment |
Places comments after an option that will not be seen by respondents, but will provide better documentation for the survey code. | {# randomize but keep this option and the next one together} |
condition |
Evaluates a conditional statement. If the statement returns true, the option is displayed; if false, the option is hidden. Although the |
{if anyChecked($Q2,1)} |
desc |
Provides alternate text to display for reports. | {desc: KPCs table} |
exclusive |
Used with multi-select/checkbox questions, ensures an option cannot be selected with others. If other options are already selected, they will be deselected. |
Exclusive of all other options:
Exclusive of options 4 and 5:
|
explain |
Creates an "i" icon for more information, displaying helpful text when the cursor hovers over the icon. | {explain: (e.g., chocolate based sweets)} |
goto |
Routes respondents to a question, table, label, or group. | {goto: Q25} |
image |
Links an image file with an option. Accepts file types like .jpg/.jpeg, .png, and animated .gif. Additional parameters can be applied to override default display formatting. |
{image: filename.jpg} |
(alias |
Creates a variable that is punched when the option is selected and can be referenced in condition logic on downstream questions. |
{mark as: MALE_QS1} |
option data |
Creates a named label to append custom option data to list items. Option data decorators require double curly braces. | {{LC: lower case text}} |
qualify |
Qualifies respondents who select the list option with the decorator. Conversely, this also terminates respondents who select only non-qualifying options in the list. This is the opposite of the |
{qualify: y} |
set value |
Populates a survey field with a particular value. | {set question: Q2 value: 1} |
term |
Terminates respondents who select the list option with the decorator. This is the opposite of the |
{term: y} |
text |
Applied at a listcall to modify or augment the text coming from all elements of a list. Can also replace the |
|
translate |
Specifies if an option will be included in the Excel output for translations or not, or if it should only be translated for specific languages. |
Option will not be translated:
Option will be translated only for the specified language:
|
weight |
Specifies the weight of the option if used with the selectby tag or with a quota. |
|
Comments
0 comments
Please sign in to leave a comment.