Skip to main content
Streemlined uses JSONata for data transformation. JSONata is a lightweight query and transformation language for JSON.

Basic Syntax

/* Access fields */
customer.name

/* Transform structure */
{
  "fullName": customer.firstName & " " & customer.lastName,
  "orderTotal": items.price ~> $sum()
}

/* Filter arrays */
items[price > 100]

/* Conditional logic */
status = "premium" ? discount * 0.2 : discount * 0.1

Variables

You can define variables for reusable logic:
(
  $taxRate := 0.08;
  $subtotal := items.price ~> $sum();
  {
    "subtotal": $subtotal,
    "tax": $subtotal * $taxRate,
    "total": $subtotal * (1 + $taxRate)
  }
)

Built-in Functions

JSONata provides many built-in functions: Examples:
FunctionDescriptionExample
$sum()Sum array valuesitems.price ~> $sum()
$count()Count items$count(items)
$now()Current timestamp$now()
$string()Convert to string$string(id)
$number()Convert to number$number(amount)
$lowercase()Lowercase string$lowercase(name)
There are truly amazing playgrounds to help familiarize yourself with JSONata:

Next Steps