# Array with two values together

**URL:** <https://discourse.nodered.org/t/array-with-two-values-together/66100>\
**Category:** General\
**Created:** [6 August 2022 09:06 UTC](https://discourse.nodered.org/t/array-with-two-values-together/66100 "2022-08-06T09:06:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [6 August 2022 09:06 UTC](https://discourse.nodered.org/t/array-with-two-values-together/66100/1 "2022-08-06T09:06:27Z")

</div>

Hi!

I have an array with two values. Once cat\_id. and pro\_id.  
Is it possible to add all the same pro\_id together?

Here's an example.  
 ![Bildschirmfoto 2022-08-06 um 11.05.50](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/8/e8ed4943d8a0defb451e504e8a5eca2f15ec18a5.png)

array  
0  
cat\_id = 3114  
per\_id = 3114

1  
cat\_id = 3114  
per\_id = 3474

result

cat\_id = 3114  
per\_id = 3114.3474

I hope someone can help me.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 August 2022 10:08 UTC](https://discourse.nodered.org/t/array-with-two-values-together/66100/2 "2022-08-06T10:08:47Z")

</div>

Yes it's possible using a change node and JSONata or in a function node

 ![chrome_screenshot_1659780440998](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/a/1a47736a5a0d2167faab9c858bb1e04bdafb1296.jpeg)

---

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [7 August 2022 08:41 UTC](https://discourse.nodered.org/t/array-with-two-values-together/66100/3 "2022-08-07T08:41:38Z")

</div>

Hi!

Thanks a lot for this.

Can you please send me the flow?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 October 2022 08:42 UTC](https://discourse.nodered.org/t/array-with-two-values-together/66100/4 "2022-10-06T08:42:23Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
