In this article
Customize access to raw survey data with filters and options in config dataExport block. Choose file type and statuses for export. Add information box.
Note
You can customize the level of access to the raw data that dashboard users have by adding filters and options to the config dataExport code block in the dashboard CDL.
You have the ability to define the exact content of the export without granting the user any selection privileges.
You can give the user the power to choose the desired file type and/or statuses for their export.
If Survey Designer has created templates, you can give users the option to choose a template for use.
By allowing users to make selections, when they click the Data Export button, an overlay will appear for them to choose the desired outputs.
Note
By separating options with a comma in the CDL (e.g. "Complete", "Incomplete"), the overlay will present the user with the option to choose between them. However, if the options are separated with OR (e.g. "Complete" OR "Incomplete"), the user won't be able to select, and all specified options will be exported automatically.
Specifying the Statuses to be Exported
To export only data from records with a specific status, such as Completes and Incompletes without giving users the ability to make changes, you can add the statusFilter line to the code block and specify the desired statuses for export, for example:
config dataExport {
rawDataExport {
survey: @cr.linkedSurveyId
tool "Export survey data to Excel"
statusFilter: "Complete" OR "Incomplete"
fileType: Excel
}Allowing Users to Select Which Statuses are Exported
By setting statusFilter to all(), you give users the option to choose the statuses they want to export. When they click the Data Export button, an overlay will appear for them to select the desired statuses.
config dataExport {
rawDataExport {
survey: @cr.linkedSurveyId
tool "Export survey data to Excel"
statusFilter: all()
fileType: Excel
}Specifying Which Types of Data File can be Exported
The fileType code line specifies the file type or types that can be exported, including all standard file types. If you list multiple file types, when the user clicks the Data Export button, an overlay will appear and the user can select their desired file type from a drop-down list.
config dataExport {
rawDataExport {
survey: @cr.linkedSurveyId
tool "Export survey data"
fileType: Excel, ExcelWithLabels, DelimitedTextFile, SPSS, SPSSSav
}
Note
Note If the user can choose the export file type, you may want to edit the tooltip text for the Data Export button, such as changing "Export survey data to Excel" to "Export survey data."
Adding an Information Box
You can include an information box in the overlay to provide instructions to the user. The dialogDescription line creates the blue info box shown in the figure below:
config dataExport {
rawDataExport {
survey: @cr.linkedSurveyId
tool "Export survey data"
statusFilter: all()
fileType: Excel, ExcelWithLabels, DelimitedTextFile, SPSS
dialogDescription: "Use this to download survey data"
Enabling a Data Template
If the survey that provides the data has templates created in Survey Designer, you can either specify which template to use for the export or give users the option to choose a template for use. Click here to refer to the separate Survey Designer documentation for more details.
To specify the template to be used or allow the dashboard user to choose from a limited number of templates, add the dataTemplate:... row to the code and specify the template name or all the template names, respectively. If you want the user to be able to select from any of the templates available in the survey, add all(). If multiple templates are available, an overlay with a drop-down list of templates will be included.
config dataExport {
rawDataExport {
survey: @cr.linkedSurveyId
tool "Export survey data"
statusFilter: all()
fileType: Excel, ExcelWithLabels, DelimitedTextFile, SPSS
dataTemplate: all()
dialogDescription: "Use this to download survey data"
}