In this article
1: Data Templates Overview
The Data Templates functionality enables you to create export templates directly within the Survey Designer interface via the Data menu of any launched survey, and export the survey data via the Overview menu. You can also use these templates to specify which columns are to be presented in the Respondent and Response views in the Data View tab. For export templates, the following capabilities are provided:
- You can select required variables from the drag and drop user interface.
- You can order the selected variables within the interface.
- You can access survey loops.
- You can duplicate templates within the same survey.
- You can create flattened templates.
The following limitations apply:
- The system does not manage specific column position within fixed-width formats, but will maintain the order as designed in the editor.
- It is not possible to create "flattened" templates. It is however possible to select "single file" in the export menu to get a flattened data export with the template.
- It is not possible to share templates across different surveys.
The Data Templates list is as shown in the example below.
The Additional Items menu icon to the right of the template allows you to edit, duplicate and delete a template.
2: Creating a New Export Template
To create a new template:
- Open the survey and click Data in the main menu bar.
- In the left column, click the Data Templates icon.
- Click New Template.
- Type a name for your template into the Template Name field.
- Add the variables you want to include in the template by moving them from the left column into the right column. There are several ways of doing this:
- You can click +Add All to move all the variables simultaneously.
- You can select individual or multiple variables in the left column and click +Add to move the selected variables.
- You can select individual or multiple variables in the left column, then click on one of the selected variables and drag them to the right column. Note that when multiple variables are selected then the number of variables being moved in indicated beside the drag field.
- In the event variables are moved to the right column in error, select then in the right column and click -Remove.
- Reorder the variables as necessary by dragging and dropping.
- When the template is as required, click Save Template.
The left column lists all the variables that are in the survey, buttons to move variables between the columns are in the center, and the right column lists the variables that are to be included in the template. ResponseID is in the right column by default and is set to be the key field.
The overlay closes and you are returned to the Data Templates list.
To use the template when exporting data (go to Exporting the Survey Data for more information).
To use the template to present response data (go to Response Data for more information).
3: Dynamic Data Templates
3.1: About Dynamic Data Templates
Note: This feature is currently in limited availability, to request access, send an email to innovations@forsta.com.
Dynamic Data Templates are constructed using CDL and can be created without the need to reference specific variables.
You can use filter functions to select groups of variables efficiently, and include or exclude variables using filter functions, or by referencing QIDs.
Tip: Dynamic templates can be duplicated and applied to other surveys.
3.2: Creating a New Dynamic Data Template
To access Dynamic Data Templates, follow these steps:
In Survey Designer, click on the "Data" Tab in the top ribbon.
Click the "Data Templates" icon from the sidebar.
Click the New Template button.
Click the CDL Icon to access the CDL editor.
Enter your Custom CDL Code (refer to examples below).
Click the Save Template button.
3.3: CDL Examples
3.3.1: CDL Example A:
config dataTemplate {
linkedSurveyId: p1000453
label: "My data template"
variableSet {
table: response: // Loop level
variables: :q1, :q2, :q3,
category("demographic"),
type("multi" ,"single"), !:q10 // ! Means exclude
}
variableSet {
table: l1: // Loop level
variables: :l1, :q41 // Note the colon before
the variable name
}
}3.3.2: CDL Example B:
config dataTemplate {
linkedSurveyId: p924999938535
label: "Complex data template"
variableSet {
table: response: variables:
system(),!:respid, !:lastchannel, !:lastdevicetype, !:la
strenderingmode, !:last_touched, !:first_question_on_las
t_page_displayed,category("demographic"),
type("multi","text"), !:gender,:respid
}
variableSet {
table: carLoop: variables: :features,:options
}
variableSet {
table: optionLoop: variables: all()
}3.4: Available Filter Functions and Type Names
3.4.1: Filter Functions
| Filter function | Parameters | Description |
| all | none | Selects all variables from a table |
| background | none | Selects all background variables |
| category | string[] - list of categories | Selects all variables with the specified question categories |
| normal | none | Selects all normal variables |
| system | none | Selects all system variables |
| type | string[] - list of variable types | Selects all variables of the specified types. See list of supported types in table below |
3.4.2: Type Names
| Type name | Returns |
| single | all standalone single variables including standalone rating ones. |
| multi | all multi variables |
| date | all date variables |
| opentext and text (as short alias) | all standalone open text variables and all "Other specify" variables |
| numeric | all standalone numeric variables |
| rating | all standalone single variables with scores |
| geolocation | all geolocation variables |
| grid | all sub-variables of all grid questions |
| numericlist | all sub-variables of all numeric list questions |
| opentextlist and textlist (as short alias) | all sub-variables of all open text list questions |
| ranking | all sub-variables of all ranking questions |
| ratinggrid | all sub-variables of all grids with scores |
| other | all the "Other specify" variables |
| audio | all audio questions |
| video | all video questions |
| image | all image questions |
| multimedia | all multimedia questions both audio, video and image |