Need Advice With Sum Of Array

I’m not having any success with getting the array sum formula to work for my scenario. I am trying to calculate the sum of the package_value_p__month within the arrays of each of the bundles in the attached screenshot.

The correct answer is 10,000 (4,000 from Array 1 + 6,000 from Array 2).

I have tried the numeric aggregator module but the sum is only calculated for the first array in the bundle - it doesn’t factor in the other arrays within in the bundle.

As you can see in this screenshot, the only number the sum function picks up on is the the top array’s package_value_p__month (4000).

Does anyone have a solution for this? Any help is appreciated :slight_smile:

Hi @Megaphone, you can use Map function to map package_value_p__month in “Set Multiple Variable”, or remove all the aggregators and iterator, just connect the list board’s item with the number aggregator. When all the values are in the same array (without having collection), then you can use the number aggregator.

Let me know if it works :slight_smile:

1 Like

I was playing around, made a dummy structure similar to yours and was able to achieve this with this formula:

{{sum(map(1.Array; “Array[1].mappable_column_values.package_value_p__month”))}}

Hope this helps.

My input data looks like this:

And when I send that via a webhook and just output the data using a set variable module I get this: