The add helper sums two or more numeric values and returns the total. Use it to combine field values such as quantities, costs, or adjustments within a flow. It accepts integers, floats, and numeric strings.
Syntax
{{add number1 number2...}}
number1, number2,... -- Two or more numeric fields or literal values to add together. Each argument must be numeric or parseable as numeric.
Examples
Add quantities from array elements
{{add record.items.[0].quantity record.items.[1].quantity}}
Input: first item quantity is 2, second item quantity is 1
Output: 3
Add hard-coded values
{{add "2" "5"}}
Output: 7
Combine multiple fields including negative values
{{add record.tax record.shipping record.discount}}
Input: record.tax is 5.25, record.shipping is 10, record.discount is -2
Output: 13.25
Negative values are handled naturally -- pass discounts or adjustments as negative numbers to subtract them from the total.
Usage notes
- You can pass any number of arguments; the helper adds them all together.
- All arguments must be numeric or parseable as numeric. Non-numeric values produce unexpected results.
- To add all elements of an array in a single expression, use the sum helper instead.