Skip to Content
DocumentationExpressionsOverview

Expressions

Forge Json includes a built-in expression engine that lets you write dynamic formulas using the {{expression}} syntax. Expressions are used across multiple features to transform, filter, and compute values.

Where expressions are used

FeatureWhat expressions doExample
Find & ReplaceDynamic replacement values using the old variable{{old.toUpperCase()}}
Tabular OperationsFilter rows, compute new columns, conditional updates{{age >= 18}}
Generate CSVMap JSON fields to CSV columns{{stringify(address)}}
Compute FieldsCreate derived fields from existing data{{price}} * {{quantity}}

Quick examples

String transformation (Find & Replace)

Search: hello Replace: {{old.toUpperCase()}} Result: HELLO

Row filtering (Tabular Operations)

Condition: {{age >= 18}}

Given [{"name": "Alice", "age": 25}, {"name": "Bob", "age": 12}], this keeps only Alice’s row.

Computed field

Expression: {{firstName}} {{lastName}} Target: fullName

Given {"firstName": "Jane", "lastName": "Doe"}, produces {"firstName": "Jane", "lastName": "Doe", "fullName": "Jane Doe"}.

Math

Expression: {{price * quantity}}

Given {"price": 10, "quantity": 5}, returns 50.

How it works

The expression engine uses JSEPΒ  (JavaScript Expression Parser) to parse expressions into an abstract syntax tree (AST), then evaluates them safely β€” no eval() is ever used.

Expressions are read-only β€” they can access and compute values but cannot modify the original data. Transformations are always applied as new values.

Security

The expression engine enforces strict safety rules:

  • AST-based evaluation β€” no eval() or new Function()
  • Maximum recursion depth of 20 levels
  • Forbidden property access β€” __proto__, prototype, and constructor are blocked
  • No computed property access β€” obj[key] syntax is not allowed; use dot notation instead
  • Whitelisted functions only β€” only approved Math, Date, and utility functions are available

Next steps

Last updated on