Lists are collections of elements (items) organized in a sequential order. Lists are a fundamental component of IntelliSurvey's Survey Programming Language (SPL). They are used as question options, table rows/columns, or for repeating questions using blocks or loops.
For discussion on which types of lists are appropriate for different situations, please refer to Lists overview.
Creating lists
Lists that are defined within a question or variable are known as inline lists, whereas lists defined independently of a question or variable via the setlist
widget are known as setlists. The following articles describe different ways to create and reference lists in IntelliSurvey's SPL.
Questions (also tables and other widgets) can reference lists that are defined in other questions by applying a list call tag. Common list call tags are optsfrom
, rowsfrom
, and colsfrom
.
See the following articles for more information on creating and referencing lists.
- Creating standalone lists (setlists) — Create standalone lists with the setlist widget to be referenced elsewhere in the survey
- Referencing lists — Use lists throughout a survey via list call tags
- Derived lists — Reference inline lists from other questions and tables
- Crosslists — Create a list that combines items from two or more previously defined lists
-
series as a list — Create a list that is a sequence of only numbers or letters, without option text via the
series
tag
Modifying lists
Lists can be modified in a number of ways, such as altering the list order, inserting headers, or using conditional logic to hide items based on the respondent's previous answers.
One way to modify lists and their elements is by applying decorators. Element decorators are pieces of code written on the same line as a list call or list item that provide additional text, logic, or other modifications. Option data decorators are user-defined decorators added to list items that allow for additional custom data such as alternate text or logic.
The following articles provide information on different ways to manipulate lists in survey programming.
- Element decorators — Modify list items in a variety of ways, such as hiding them conditionally or adding alternate text for use in reports
- Including and excluding options — Reference a subset of items from a list
- Option data decorators — Add user-defined data to list items to help with various tasks, such as manipulating text or logic across the list
- Randomizing and controlling option order — Modify the order in which the list items are displayed
- Collection headers — Insert headers as list items to visually organize the list
- Collections and order theory — Manage list order and organization with collection headers
Spreadsheets
Spreadsheets (or "sheets") are data sources uploaded to the Admin User Interface (UI) separately from the survey code. They are a versatile tool that can function as lists, as well as databases for lookup tables. The column names in a sheet can be used similarly to element decorators in lists, making them useful for long lists, or lists that require numerous decorators. The following articles cover uploading and using spreadsheets in surveys.
- Managing survey spreadsheets with the Spreadsheets applet — Upload and manage sheets in the Admin UI
- Using spreadsheets in survey programming — Reference sheets in survey programming
- fetch_cell and fetch_row — Use survey variables to retrieve data from a sheet
Comments
0 comments
Please sign in to leave a comment.