Sum array (this must be at least 15 characters, I guess)

Hi,

Does anybody know how to sum the values of an array. Like

{
“test”: [
250,
500
],
“total”: 750
}

I managed to do this a while ago, but now I can’t remember how I did it.

Regards,

Jos

To answer my own question, I just tried a jmespath solution: &{sum(test)}, and that works

1 Like

Hi @jos

We are glad to hear that you managed to find the solution using the JMESPath Built-in function.

Alternatively, you can also use “Value Mapper” and “Operator” mapper. Set the Operator to “Addition”, and you will get the sum of the values.