In this article
Use the Action tab to input scripting code to specify actions that are to be performed on the data - .
Figure 1 - Example of the Action tab
Note: You are not required to enter information into this tab. Any scripting entered on this tab must be in JSCRIPT.NET. Refer to MSDN.COM for further details.
Fields selected in the Source tab (go to Source Types for more information) are listed in the Available Variables column. These fields are available as Strongly Typed Properties in the script code.
If you wish to change data, write the required action into the field on the appropriate tab. The tabs are as follows:
- Script – write in here the actions that are to be run on the selected source records. The actions are run once for each record.
- Global Variables – you can define script properties that will be available to all records. They must then be defined here.
- Global Script – actions written here are run once at the beginning of the process. A typical example would be if you want to execute a Customer Code library before running the actual Data Processing script. In this case you could write for example:
GlobalScript:
zipCode2CityMap = MyCustomCodeLib.GetZipCode2CityMapping();
- Post Script - actions written here are performed once, after all other actions have been performed.
Note: If you want to perform action scripting based on interview_start, you must add the interview_start variable.
Note: Respondents who close the survey before completing will have their status set to "null" in the database. If you want to update respondents with the status “Incomplete”, ensure “Incomplete” or “All” are selected under “Source” and use the action script:
If(status == null) { //update respondents with status incomplete}
Further information on scripting in Data Processing is given in the Scripting Language chapter (go to About Data Processing Scripting for more information).
Note: The Syntax Highlighter functionality automatically color-codes key words, and provides lists of selectable options under specific conditions while scripting (refer to the Professional Authoring documentation for more information). The Syntax Highlighter functionality is on by default for a survey, but you can switch it off in the User Settings.