The series function can be used with list calls such as optsfrom, rowsfrom, or colsfrom to automatically generate sequential list options.
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, the series function offers more flexibility and is recommended for most use cases.
Details
-
The
seriesfunction is valid on any widget (question, table, variable, etc.) where options can be directly placed, including standalone lists. -
The
seriesfunction 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]. - You can apply the
textdecorator with option data such as[id]to modify option text.
Additional examples
Creating a standalone list
If a list using the series function is used for multiple questions, a set list can be defined with the function instead of having to redefine the list on each question.
set list: YEARS
optsfrom: series[2001..2025]
2. In what year did you start working for IntelliSurvey?
type: pulldown
optsfrom: YEARS
Using sequential and reverse order
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.
set list: 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(*)]
Using non-continuous sets
The series function also accepts non-continuous 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 decorators
The text decorator and the [id] placeholder can be used alongside the series function to pipe in a specific text. In the example below, the rows 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.