JSONata TransformValue

JSONata TransformValue

Certified

Transform or query a JSON string using JSONata

JSONata is a query and transformation language for JSON data.

yaml
type: io.kestra.plugin.transform.jsonata.TransformValue

Transform JSON data using a JSONata expression

yaml
id: jsonata_transform_value
namespace: company.team

tasks:
  - id: transform_json
    type: io.kestra.plugin.transform.jsonata.TransformValue
    from: |
      {
        "order_id": "ABC123",
        "first_name": "John",
        "last_name": "Doe",
        "address": {
          "city": "Paris",
          "country": "France"
        },
        "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": first_name & ' ' & last_name,
        "address": address.city & ', ' & address.country,
        "total_price": $sum(items.(quantity * price_per_unit))
      }
Properties

The JSONata expression to apply on the JSON object

The value to be transformed

Must be a valid JSON string.

Default1000

The maximum number of nested evaluation levels allowed for the JSONata expression

Bounds how deeply the expression may nest while it is evaluated, which is what caps runaway recursive functions. The limit depends only on the expression, never on how many records are processed: the default of 1000 is far above what ordinary expressions reach, and a batch of 1,000,000 records needs no higher a value than a batch of 10 does. Raise it only for expressions with proven deep recursion needs — each level adds frames to the chain traversed by variable lookup, so very high values trade the clean error for a JVM StackOverflowError.

Reference (ref) of the pluginDefaults to apply to this task.

The transformed value