SurveyDataExport
Description
Start a Survey Data Export task for a given project using parameters in the DataExportParameters object. This is the same process as exporting data via the GUI.
Signature
long SurveyDataExport(string key, string projectId, DataExportParameters dataExportParams)
Parameters
Name | Data Type | Description |
---|---|---|
key |
string required |
The authentication key |
projectId |
string required |
The project ID |
dataExportParams |
DataExportParameters required |
Survey Data Export parameters |
Example
var surveyId = "pXXXXXXXXXXX"
var taskManagementSoapClient = new TaskManagementSoapClient();
var dataExportParameters = new DataExportParameters()
{
DatabaseType = DatabaseType.Production,
FileTransferType = FileTransferType.Email,
FileType = FileType.ExcelWithLabels,
LoopHandling = LoopHandling.SingleFile,
QuotedValues = false,
FileName = projectId + "_excel",
TextInQuestionLabels = TextInQuestionLabels.TitleAndText,
Language = language,
Locale = -1,
OpenEndsWidth = 0,
ExcelVersion = ExcelVersion.MsExcel2007,
Comment = "Excel export",
EncryptFile = false,
FilterExpression = "gender = 2",
ResponseFilter = new[]
{
ResponseFilter.Complete,
ResponseFilter.Error,
ResponseFilter.Incomplete,
ResponseFilter.QuotaFull,
ResponseFilter.Screened
},
EmailingOptions = new EmailingOptions()
{
PlainTextBody = "Data attached!",
Recipient = "john.doe@example.com",
ReplyTo = "john.doe@example.com",
Subject = "The data you requested"
},
};
var taskId = taskManagementSoapClient.SurveyDataExport(key, surveyId, dataExportParameters);