Skip to content

Commit

Permalink
docs: add another example
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-geller committed Oct 14, 2024
1 parent 332c60b commit 2e90a2e
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,28 @@
"total_discounted_price": $sum(products.(price-(price*discountPercentage/100)))
}
"""
),
@Example(
title = "Calculate the total price per order from a JSON file.",
full = true,
code = """
id: jsonata
namespace: company.team
tasks:
- id: extract
type: io.kestra.plugin.core.http.Download
uri: https://huggingface.co/datasets/kestra/datasets/resolve/main/json/orders.json
- id: jsonata
type: io.kestra.plugin.transform.jsonata.TransformItems
from: "{{ outputs.extract.uri }}"
expression: |
Account.Order.{
"order_id": OrderID,
"total": $round($sum(Product.(Price * Quantity)), 2)
}
"""
)
}
)
Expand Down

0 comments on commit 2e90a2e

Please sign in to comment.