Articles in this section

add helper

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.

Usage

{{add number1 number2 ...}}
  • number1, number2, ...: Any valid numeric inputs (fields or literals).

Examples

  1. Summing order item quantities

    {{add record.items.[0].quantity record.items.[1].quantity}}
    

    If the first item has a quantity of 2 and the second item has a quantity of 1, it returns 3.

  2. Adding hard-coded numbers

    {{add "2" "5"}}
    

    Returns 7.

  3. Combining multiple fields

    {{add record.tax record.shipping record.discount}}
    

    If record.tax is 5.25, record.shipping is 10, and record.discount is -2, this returns 13.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.