SUM returns the total of one or more numbers and arrays as arguments. It can take an arbitrary number of optional arguments.

Function category: Statistical

For numerical functions (like SUM, AVERAGE, and ROUND), incoming values will be coerced into numbers where possible. If a key in the data source has been deleted (meaning no value is now returned), this will yield an error as a null value cannot be coerced into a number.


SUM(arg1, [arg2, ...])




Number or array.


Optional. Same requirements as arg1.


Let's say we're given a response with the following vehicle information:

"model":"Mustang GT500",

Example 1: Find the value of the sum of two keys

If we want an create an endpoint with an attribute called horsepower_plus_weight, we can access and sum the values of the respective keys of the vehicle_info object using this function.

# Sum two diferent values
SUM(vehicle_info.horsepower, vehicle_info.weight_kg)
# Returns 2180

Example 2: Find the value of multiples of a single key

If we want to find the sum of multiples of the same value, use the following function.

# Sum two identical values
SUM(vehicle_info.horsepower, vehicle_info.horsepower)
# Returns 920

Example 3: Find the value of a single key

If we want to find the value of a single key, which in this case is the number of cylinders, use the following function.

# Sum of a single value
# Returns 8

Example 4: Find the value of integers and a single key

If we want to find the value of a set of four integers and one reference, use the following function.

# Sum of integers and a value
SUM(20, 20, 25, 25, vehicle_info.horsepower)
# 550