Skip to main content

Expressions

Expressions in the form-builder are a read-only type of question, which allow to use results from other questions for calculation and validation.

Example where values from other questions are summed up

Location

In the Form builder this feature can be found in the toolbox under expression. Drag and drop this to your survey.

Found in the Toolbox->Question Library under Expression (read only)

Quick start / Basic usage

You need to set up your expression in order to display the desired values.

Properties of the expression

  • Drag and drop to survey and enter the properties
  • Enter a name which will be displayed as title in your form
  • Enter the desired expression (see Feature description below for details)
  • Choose a display style and if desired, change the currency

Feature description

Here are some examples for expressions

Calculations with numbers

You can use any numeric values for calculations such as

  • 6 * 7
  • 8 + 34
  • 504 / 12

Calculation with variables

You can access variables via curly braces. Make sure you have the correct value name from the question. For values inside matrixes, you need the value names from the columns and rows as well, divided by a period

  • {question1_value_name} + {question2_value_name}
  • {price_list.item1.price}

Calculation with arrays

If you are using a matrix, you can also sum up all values with sumInArray:

  • sumInArray({your_list_name}, 'value_name')
Example for SumInArray. The value name of the Full Time row is 'FT'

Functions

iif(), today(), age(), min(), max(), count(), avg(), createdAt(), modifiedAt(), weekDay(), addDays()

Calculation with functions

Compute publication dates taking account of weekends:

addDays({date_from}, iif(weekday({date_from}) > 5, 9 - weekday({date_from}), 1))

Advanced functionalities

To go further, please check this link.