Script tools in Survey123 Connect
The following tools are available on the on menu of the Scripts tab of Survey123 Connect:
- Open scripts folder—Launch the file browser at the location of the Scripts folder of your survey.
- New script file—Create a script file in the Scripts folder of your survey. Enter the filename and click Create.
- Select function—Highlight the first function in the opened file and present the parameters for testing.
- Save—Save changes to the opened file.
Click the Select function tool to test the behaviour of the first function in the file by entering values for each parameter and viewing the output. Once you are finished with the function, you can copy the pulldata statement presented here and paste it in the XLSForm. If you are signed in to your organization, right-click any of the parameters and click Paste token, if required.
Each of these produces a JSON object with individual questions as properties in that object.
- online—A Boolean value indicating whether the device has network connectivity.
- language—The language currently used in the survey.
- timezone—The time zone code.
- utcoffset—The offset in hours from universal coordinated time (UTC) for the local time zone.
- Document Object Model (DOM) is not supported.
- Frameworks such as JQuery, Ember, and Angular are not supported.
- You cannot access local files.
- Asynchronous calls are not supported.