Conditions

The concept of conditions, allows for extensive input validation to keep your data consistent at all times.

A condition is a boolean expression when evaluated either allow or prevent:

  • Section Actions

  • Form submit (backend validated)

Example:

condition: - expression: "{{in SELECTED_STATUS 'STATUS1' 'STATUS2'}}" errorMessage: 'only STATUS1 or STATUS2 are allowed' - expression: "{{in SELECTED_EMAIL PORTRAIT_USER_EMAIL}}" errorMessage: 'you can only edit your own entries'

Multiple Conditions can be set. All conditions need to match. (Logical AND between all conditions). You can build more complex rules with nested handlebars.

- expression: "{{or (in SELECTED_STATUS 'STATUS1' 'STATUS2') (eq PORTRAIT_USER_ROLE 'ADMIN')}}" errorMessage: 'only STATUS1 or STATUS2 are allowed, Admin can do anything'

Â