Question
Document Generation API issue with evaluating a complex formula
I am trying to add up the Price of the Items and I can do it with the formula in the JSONata 'try' editor. But when I pass the same in the MS Word doc, it display the formula as it is instead of the expected value.
JSON:
{
"PurchaseDetails" : {
"Name" : "ATL062",
"Down_Payment__c" : "900",
"Items" : [ {
"Price" : "900"
}, {
"Price" : "6,565"
} ]
}
}
JSONata
$sum((
$orderCosts := $map(PurchaseDetails.Items, function($order) {
$parseInteger($order.Price, '#,##0')
});
$orderCosts
))
