Skip to main content

Enable Transforms

1

Add Fields

Add your form fields
2

Enable

Toggle Transform data before saving

Write Transform Expression

Use JSONata to modify the form data. The expression should return the transformed object.

Example: Add Computed Field

Count selected projects and add timestamp:
$merge([
  $,
  {
    "total_projects": $count(projects),
    "configured_at": $now()
  }
])
Input:
{
  "warehouse_id": "wh-123",
  "projects": [{"value": "1"}, {"value": "2"}]
}
Output:
{
  "warehouse_id": "wh-123",
  "projects": [{"value": "1"}, {"value": "2"}],
  "total_projects": 2,
  "configured_at": "2024-01-15T10:30:00Z"
}

Example: Flatten Values

Extract just the IDs from selections:
{
  "warehouse_id": warehouse_id,
  "project_ids": projects.value
}
Output:
{
  "warehouse_id": "wh-123",
  "project_ids": ["1", "2"]
}

Common Functions

FunctionDescription
$merge([a, b])Combine objects
$count(array)Count items
$now()Current timestamp
$sum(array)Sum numbers
$join(array, sep)Join strings