In this article
Below is a list of the functions available in Data Processing:
| Function | Description | Example |
|---|---|---|
| Adds an error message to the task log, highlighted with red error icon. |
|
| Adds a message to the task log, highlighted with information icon. |
|
| Adds a warning to the task log, highlighted with question mark icon. |
|
| Returns the average of the specified values. |
|
| Sets the value of the specified variableId to NULL for all answers in a question variableid with loop reference answerlist. |
|
| Returns an int containing the responseid of the current record. |
|
DeleteCurrentContact() | Can be used in addition to execution mode “delete data” in Data processing rules to delete contacts from a contact database. | DeleteCurrentContact() |
| Permanently deletes the current response record from the survey database. Note: Survey database (same project) must be selected as Source and Target in the Data Processing rule, a filter must be applied in the Source Tab, and “Delete Data” must be selected as Execution Mode in the Target tab. |
|
| Permanently deletes both the current response record from the survey database and the corresponding respondent record from the respondent database. Note: Survey database (same project) must be selected as Source and Target in a Data Processing rule, a filter must be applied in the Source Tab, and “Delete Data” must be selected as Execution Mode in the Target tab. |
|
| Permanently deletes the current respondent record from the respondent database if it is not answered and also meets the Source tab record filter. Note that respondent Data (same project) must be selected as the Source and Target in the Data Processing rule. Additionally, a filter must be applied in the Source Tab, and “Delete Data” must be selected as Execution Mode in the Target tab. |
|
| Returns the codes of the specified question where the question uses a normal answerlist. This is not supported for hierarchy and table lookup questions. |
|
| Retrieves answer label for provided code | |
| Retrieves code for provided label | |
| Returns all questions which were selected as columns in the Data Processing rule. | |
| Returns all questions which have the question category specified as variable property and are selected as columns in the Data Processing rule. |
|
| Returns an array of QuestionInfo objects for all the questions of a specific type (Single, Multi, Grid, Numeric, Date, OpenText, OpenTextList, Ranking, NumericList). |
|
| Returns the scales of the specified Grid question. |
|
| Returns the value of the current respondent for a specified question. |
|
| Returns true if a variable doesn't have any data (null in the database), and false if not. |
|
| Function for sending an email. Parameters are: • from: Message sender address |
|
| Used for setting status, it will also update the system field "state" correctly, so that for example when switching from complete to incomplete, the respondent will be allowed to open the survey when "Allow recipient to re-enter a complete interview" is not set. SetInterviewStatus( status); • InterviewStatus.Incomplete |
|
| Adds or updates a loop record of current respondent with specified value for the specified variable in the specified loop iteration. The value used depends on the variable type. If the specified loop record already exists then it will be updated, if it doesn’t yet exist it will be added – it is not possible to do both for the same respondent record in the same action script. Note that nested loops are not supported. |
|
| Used to assign the null value to a variable. |
|
| Sets the value of the current respondent for a specified question. Depending of the question type, the value needs to be set accordingly. Example: If a Multi question is used the value needs to either set to true or false, if a Numeric question is used a decimal value can be applied. |
|
| Skips the record and moves to the next in the DP rule. |
|
| Returns an array containing the weights for the given fields. The fields must be questions having a weighted answer list, otherwise the script will fail. |
|