Trying to divide fields in a nested structure but handlebar expression is not working
AnsweredHi,
I'm trying to get a rate by dividing amount by quantity. Both amount and quantity produce values when mapped individually but when I use the following handlebar expression, the output is empty.
{{divide order_items.OrderItems[*].ItemPrice.Amount order_items.OrderItems[*].QuantityOrdered}}
Am I missing something?
Thanks
0
-
Hi Chidi Okwudire,
I think the problem is caused by your use of wildcards (*) in the handlebars expression. integrator.io doesn't iterate through all of the amounts and quantities in the array when attempting to calculate the expression. You would have to use a preMap hook to perform the operation.
Tom
0 -
Hi Tom Santiago,
Thanks for the clarification!
0
Please sign in to leave a comment.
Comments
2 comments