Use {{add}} to sum any number of numeric values—integers, floats, or decimals. You can pass in numeric fields from the record or hard-coded values.
{{add number1 number2 ...}}
-
number1, number2, ...: Any valid numeric inputs (fields or literals).
-
Summing order item quantities
{{add record.items.[0].quantity record.items.[1].quantity}}If the first item has a quantity of
2and the second item has a quantity of1, it returns3. -
Adding hard-coded numbers
{{add "2" "5"}}Returns
7. -
Combining multiple fields
{{add record.tax record.shipping record.discount}}If
record.taxis5.25,record.shippingis10, andrecord.discountis-2, this returns13.25.
Tip
-
You can pass as many arguments as needed.
-
Ensure each argument is numeric (or can be parsed as numeric); otherwise, the helper may produce unexpected results.
-
Negative values are handled naturally, allowing you to sum discounts or other adjustments.