# I got stuck mapping again (sum value inside collection-\>array-\>collection-\>array-\>collection

**URL:** <https://community.make.com/t/i-got-stuck-mapping-again-sum-value-inside-collection-array-collection-array-collection/10315>\
**Category:** Questions\
**Created:** [May 6, 2023, 9:14pm UTC](https://community.make.com/t/i-got-stuck-mapping-again-sum-value-inside-collection-array-collection-array-collection/10315 "2023-05-06T21:14:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Davidof90](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/davidof90/32/6795_2.png) [@Davidof90](https://community.make.com/u/Davidof90)\
**Post date:** [May 6, 2023, 9:14pm UTC](https://community.make.com/t/i-got-stuck-mapping-again-sum-value-inside-collection-array-collection-array-collection/10315/1 "2023-05-06T21:14:20Z")

</div>

Hello,

I still have issues with mapping nested values.

This is the output from Monday:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/e/ecef4eea0f334d2776dbf6655a9f31022f6a3bc1.png)

This is with Array aggregator:  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/d/ddbf05c1225f0f7084f48e818bb48e2622fb1413.png)

I can use this formula to get the text value 222 out:  
{{parseNumber(17.array[4].column\_values[4].value; “,”)}}

But actually I want to **sum** all values from **collection 4** from the collections inside the first array.

So I want to SUM:

sum(array.1.column.values.4.text;array.2.column.values.4.text;array.3.column.values.4.text;array.4.column.values.4.text … )

Until the last collection.

Is this possible?

Thanks  
David

---

<div class="post-metadata">

**Author:** ![Loopz](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/loopz/32/10120_2.png) [@Loopz](https://community.make.com/u/Loopz)\
**Post date:** [May 6, 2023, 9:37pm UTC](https://community.make.com/t/i-got-stuck-mapping-again-sum-value-inside-collection-array-collection-array-collection/10315/2 "2023-05-06T21:37:57Z")

</div>

From the top of my head - I cannot experiment at the moment:

What if you apply the _map_ function to the array you created via array aggregator? The first param would be the array, second param would be ‘column\_values’.

This results in an array of arrays.

On this array you then call the flatten method to flatten the array of arrays.

On this array you call again the map method. First param the array, second param value, third param id, fourth param auto\_\_km\_

On this final array you call the sum method

---

<div class="post-metadata">

**Author:** ![Davidof90](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/davidof90/32/6795_2.png) [@Davidof90](https://community.make.com/u/Davidof90)\
**Post date:** [May 6, 2023, 10:03pm UTC](https://community.make.com/t/i-got-stuck-mapping-again-sum-value-inside-collection-array-collection-array-collection/10315/3 "2023-05-06T22:03:46Z")

</div>

> [@Loopz](#):
>
> On this array you call again the map method. First param the array, second param value, third param id, fourth param auto\_\_km\_

Nice, thank you!

I never looked into the array functions other then map() & get() yet, very interesting solution! This opens a lot of new possibilities.

---

<div class="post-metadata">

**Author:** ![FAQs](https://avatars.discourse-cdn.com/v4/letter/f/eb8c5e/32.png) [@FAQs](https://community.make.com/u/FAQs)\
**Post date:** [May 10, 2023, 11:00pm UTC](https://community.make.com/t/i-got-stuck-mapping-again-sum-value-inside-collection-array-collection-array-collection/10315/4 "2023-05-10T23:00:02Z")

</div>


