 TransformValue
TransformValue
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"Examples
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
expression *Requiredstring
The JSONata expression to apply on the JSON object.
from *Requiredstring
The value to be transformed.
Must be a valid JSON string.
maxDepth integerstring
 Default 
1000The maximum number of recursive calls allowed for the JSONata transformation.
Outputs
value object
The transformed value.
