The series
function can be used with list calls such as optsfrom
, rowsfrom
, or colsfrom
to automatically generate sequential list options within the specified upper and lower bounds.
1. How would you rate your experience on a scale of 1-5?
type: radio
optsfrom: series[1..5]
headings: Terrible, Great
Though the series
tag is similar in functionality to the series
function, the latter offers more flexibility and is recommended for most use cases.
Details
-
The
series
function is valid on any widget (question, table, variable, etc.) where options can be directly placed, including standalone lists (setlists). -
The
series
function can define either numeric or alphabetic sequences, e.g.,optsfrom: series[A..E]
. When defining alphabetic series, consistent capitalization should be used. - To display a list from highest to lowest value (or letter), you can reverse the upper and lower bounds, e.g.,
optsfrom: series[5..1]
oroptsfrom: series[Z..A]
. -
The
series
function supports the inclusion of option decorators such astext
and[id]
.
Additional examples
Defining a standalone list
If a list using the series
function is used for multiple questions, a setlist can be defined with the function instead of having to redefine the list on each question.
setlist: YEARS
optsfrom: series[2001..2024]
2. In what year did you start working for IntelliSurvey?
type: pulldown
optsfrom: YEARS
Alternative reverse order method
Though it's possible to reverse a sequential order by listing the upper bounds first, you could include order: reverse(*)
to flip the order instead. This can be particularly helpful if the options need to be shown both in sequential and reverse orders in separate questions.
setlist: YEARS
optsfrom: series[2001..2024]
2. In what year did you start working for IntelliSurvey?
type: pulldown
optsfrom: YEARS
3. In what year did you stop working for IntelliSurvey?
type: pulldown
optsfrom: YEARS [order: reverse(*)]
Defining non-continuous sets
The series
function also accepts non-continuous element sets. Simply use commas to separate any breaks in the sequence.
4. Which of the following jersey numbers would you prefer to wear?
type: pulldown
optsfrom: series[0,7..9,11..15,20..24,30]
Applying option decorators
Option decorators such as the text
decorator can be used alongside the series
function to pipe in a specific text with the option IDs in an [id]
placeholder. In the example below, the row elements created via series[1..5]
will be displayed as "Brand 1", "Brand 2", etc.
5. How would you rate the following brands on a scale from 1-5?
type: radio table
headings: Awful, Great
optsfrom: series[1..5]
rowsfrom: series[1..5] {text: Brand [id]}
Comments
0 comments
Please sign in to leave a comment.