TransformValue
TransformValue
yaml
type: "io.kestra.plugin.transform.jsonata.TransformValue"
Transform or query a JSON data using JSONata language.
JSONata is a sophisticated query and transformation language for JSON data.
Examples
Transform JSON data using JSONata expression
yaml
id: jsonata
namespace: example
tasks:
- id: transformJson
type: io.kestra.plugin.transform.jsonata.TransformValue
from: |
{
"order_id": "ABC123",
"customer_name": "John Doe",
"items": [
{
"product_id": "001",
"name": "Apple",
"quantity": 5,
"price_per_unit": 0.5
},
{
"product_id": "002",
"name": "Banana",
"quantity": 3,
"price_per_unit": 0.3
},
{
"product_id": "003",
"name": "Orange",
"quantity": 2,
"price_per_unit": 0.4
}
]
}
expression: |
{
"order_id": order_id,
"customer_name": customer_name,
"total_price": $sum(items.(quantity * price_per_unit))
}
Properties
expression
- Type: string
- Dynamic: ✔️
- Required: ✔️
The JSONata expression to apply on the JSON object.
from
- Type: string
- Dynamic: ✔️
- Required: ✔️
The value to be transformed.
Must be a valid JSON string.
maxDepth
- Type: integer
- Dynamic: ✔️
- Required: ✔️
- Default:
1000
The maximum number of recursive calls allowed for the JSONata transformation.
Outputs
Definitions
Was this page helpful?