Improper result after Copy/Mapper output
Hi,
Can anyone pls help me why the values after copy snap getting changed without any transofrmation as shown in below pics.
In place of copy snap i used mapper also. Then also showing incorrect values for the Order quantity and Order value.
Below expressions used to calculate totalOrderQuantity and totalOrderValue.
$orderLineItems.reduce((acc,curr)=> acc+curr.totalItemQuantity,0)
$orderLineItems.reduce((acc,curr)=> acc+(curr.itemDenomination*curr.totalItemQuantity),0)
Pls let me know if you need the .slp
Thankyou.
Update - this issue was not related to the Array.reduce() function, but with how the target path was defined. After a short offline discussion with @Madhu1 we were able to resolve it using a Structure snap to push the results into the target object correctly.