Background Calculations

Edit in →
Survey Creator

Custom variables serve as intermediate or auxiliary variables that perform various calculations in the background within the survey's JSON schema as respondents answer questions. These calculations are based on expressions and support built-in and custom functions. In this demo, background calculations are used to combine a full name from the provided first and last names and to calculate a respondent's age based on their birthdate.

To create a custom variable for background calculations, populate the SurveyModel's calculatedValues array with objects of the following structure:

{
  name: string; // A name that identifies the calculated value.
  expression: string // An expression that returns the calculated value.
  includeIntoResult: boolean; // Specifies whether to include the calculated value in survey results.
}

Calculated values can be used in display texts and expressions. In this demo, for instance, calculated values are displayed within an HTML element of a survey.

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.