Open End questions in scripting

Use scripting to get and set values for question types where the data is stored as an open-ended value on the back end.

The functions in this topic apply to the following question types. These question types operate with different JavaScript data types.

Supported question type JavaScript data type
Short Answer String
Long Answer String
Number Number
Date Date
Email String
Zip / Postal Code String
Phone Number String

Modern survey responding has back end validation to ensure that values for questions like Email, Zip / Postal Code, and Phone Number are valid. If validation rules are triggered by an incorrect value, the question is set to Incomplete and the response will fail if the respondent tries to proceed to the next survey page.

Function Description
question.get(); Gets a string, number, or Date. The default value for each data type is null.
question.set(openEndValue); Sets a string, number, or Date.
question.unset(); Unsets the value so that there is a default no value state for the question.