Dynamically Set and Reset Question Values

Edit in →
Survey Creator

Survey questions support API properties that let you automatically set or reset a question's value based on specific criteria. In this demo, these properties are used to copy the shipping address when a user selects "Yes" for the "Shipping address same as billing" question.

Set Question Values Dynamically

To set a question's value based on other answers, assign an expression to the setValueExpression property. The result of the expression will be used as the question's value. If you want this expression to be evaluated conditionally, use the setValueIf property to specify the condition. This property accepts a Boolean expression, and when it evaluates to true, the survey runs the setValueExpression and assigns the result to the question's value.

Reset Question Values Conditionally

To reset a question's value when a certain condition is met, specify the resetValueIf property with a Boolean expression. When this expression evaluates to true, the question's value will be reset to the defaultValue.

Refer to the survey JSON schema (json.js file) for code examples.

Your cookie settings

We use cookies on our site to make your browsing experience more convenient and personal. In some cases, they are essential to making the site work properly. By clicking "Accept All", you consent to the use of all cookies in accordance with our Terms of Use & Privacy Statement. However, you may visit "Cookie settings" to provide a controlled consent.

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.