Expression builder

1. Introduction

Expressions allow you to add logic to your registration form and perform calculations right during the registration process. You can use them to:

  • dynamically show or hide fields depending on another's field value
  • validate fields
  • make fields dynamically required

2. Using field values

To refer to a field, you can reference it by it's name, surrounded by 2 curly braces: {birthdate}

age({birthdate}) >= 21

3. Build in functions

iif

Returns the valueIfTrue value if the condition is truthy or the valueIfFalse value if the condition is falsy.

Definition: : iif(condition: expression, valueIfTrue: any, valueIfFalse: any)

Example: "expression": "iif({question1} + {question2} > 20, 'High', 'Low')"

age

Returns age according to a given birthdate.

Definition: age(birthdate: date)

Example: "expression": "age({birthdate})"

currentDate

Returns the current date and time.

Definition: : currentDate()

today

Returns the current date or a date shifted from the current by a given number of days. For example, today() returns the current date, 0 hours, 0 minutes, 0 seconds; today(-1) returns yesterday's date, same time; today(1) returns tomorrow's date, same time.

Definition: today(daysToAdd?: number)

Example: "expression": "today(2)" returns the day after tomorrow

isValidBelgianNRN

Returns true if the field is a valid Belgian National Registration Number

Definition: isValidBelgianNRN(daysToAdd?: number): Date

Example: "isValidBelgianNRN({nrn_input})"