Expressions

Compute field values with JavaScript, in the browser or on the server


The expression attribute of a form field lets you create dynamic forms with JavaScript expressions.


Introduction

The expression attribute is available on multiple field types:

  • enum field - to populate dropdown options dynamically
  • expression field - to retrieve or generate any form of data
  • table field - to populate table data dynamically

JavaScript expressions are evaluated either on the server side (default) or on the client side, as set by the field property runLocal.

  • On the server side (runLocal: false, the default) - predefined functions that fetch data from APIs, files and databases.
  • On the client side (runLocal: true) - Code leverages the full JavaScript engine in the browser sandbox for calculations, transformations, and manipulations.

Security Concerns

Because expressions are evaluated with the JavaScript eval function, code injection is a potential concern:

  • Server-side expressions are limited to predefined functions - arbitrary code cannot be injected
  • Client-side expressions are evaluated in the browser sandbox and can be considered safe

In this section

Each topic has a page of its own: