# How to push a msg object for every object in a array?

**URL:** <https://discourse.nodered.org/t/how-to-push-a-msg-object-for-every-object-in-a-array/74469>\
**Category:** General\
**Tags:** function-node\
**Created:** [31 January 2023 09:31 UTC](https://discourse.nodered.org/t/how-to-push-a-msg-object-for-every-object-in-a-array/74469 "2023-01-31T09:31:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gawan](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@Gawan](https://discourse.nodered.org/u/Gawan)\
**Post date:** [31 January 2023 09:31 UTC](https://discourse.nodered.org/t/how-to-push-a-msg-object-for-every-object-in-a-array/74469/1 "2023-01-31T09:31:32Z")

</div>

Hi,  
I have an array with 10-24 items and after processing them I would like to push each of them as a single msg to the output.

```auto

for(i = 0; i<message.length; i++){
    
    date = new Date(message[i].start_timestamp);
    
    month = date.getMonth();
    day = date.getDay();
    stunde = date.getHours();
    
    price = message[i].marketprice/10;
    
    daten.push([price, hour]);
    stunden.push(day + " " + stunde);
    preise.push(price);
    
    PUSH MSG
    
}

```

Is this possible ?

BR  
G

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [31 January 2023 09:36 UTC](https://discourse.nodered.org/t/how-to-push-a-msg-object-for-every-object-in-a-array/74469/2 "2023-01-31T09:36:37Z")

</div>

see the "Sending Messages Asynchronously" section of [Writing Functions : Node-RED](https://nodered.org/docs/user-guide/writing-functions)

---

<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:** [1 April 2023 09:37 UTC](https://discourse.nodered.org/t/how-to-push-a-msg-object-for-every-object-in-a-array/74469/3 "2023-04-01T09:37:13Z")

</div>

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