# Problem with sending multiple jsons to cloud, sends only the first one

**URL:** <https://discourse.nodered.org/t/problem-with-sending-multiple-jsons-to-cloud-sends-only-the-first-one/78681>\
**Category:** General\
**Created:** [25 May 2023 09:27 UTC](https://discourse.nodered.org/t/problem-with-sending-multiple-jsons-to-cloud-sends-only-the-first-one/78681 "2023-05-25T09:27:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![allienka](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allienka/32/79351_2.png) [@allienka](https://discourse.nodered.org/u/allienka)\
**Post date:** [25 May 2023 09:27 UTC](https://discourse.nodered.org/t/problem-with-sending-multiple-jsons-to-cloud-sends-only-the-first-one/78681/1 "2023-05-25T09:27:50Z")

</div>

Hi,  
Im sending Nordpool prices to cloud via Node-red. With the function I set the object and split after price so I have json for each hour with price. When I send it to the cloud, it shows only the first json data.

How can I send all the jsons to the cloud? I tried the delay node, but it only stops for the particular time before again sending all at once. how can I include a loop to the flow to solve this.

Thanks!

 ![Screenshot 2023-05-25 122400](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/c/5ccffec3997ba907f64f529389a5ec68e7e1de96.png)  
 ![Screenshot 2023-05-25 122409](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/d/ed5cc4bfeba0ff07befc030a128e1f3ca548fb2c.png)  
 ![Screenshot 2023-05-25 122418](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/2/a2382cee1ff10facc725878dec065b1347993720.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [25 May 2023 10:48 UTC](https://discourse.nodered.org/t/problem-with-sending-multiple-jsons-to-cloud-sends-only-the-first-one/78681/2 "2023-05-25T10:48:37Z")

</div>

In your debug display, it looks like those messages are being send at lease 5 per second.  
Are they using the same topic?  
what options are the publisher using?  
Are you sure it is the first msg that gets received or could it be the last?

You should install 'MQTT Explorer' on one of your devices so you can see what is being published. It is a great tool for looking at mqtt msgs.

---

<div class="post-metadata">

**Author:** ![allienka](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allienka/32/79351_2.png) [@allienka](https://discourse.nodered.org/u/allienka)\
**Post date:** [25 May 2023 11:02 UTC](https://discourse.nodered.org/t/problem-with-sending-multiple-jsons-to-cloud-sends-only-the-first-one/78681/3 "2023-05-25T11:02:46Z")

</div>

using the same topic and yes its the first one  
this is what the data on the cloud looks like

 ![Screenshot 2023-05-25 140023](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/b/9b4f131ce7cad365d2574d3c5ea4ab39992cecb8.png)

---

<div class="post-metadata">

**Author:** ![allienka](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allienka/32/79351_2.png) [@allienka](https://discourse.nodered.org/u/allienka)\
**Post date:** [25 May 2023 11:14 UTC](https://discourse.nodered.org/t/problem-with-sending-multiple-jsons-to-cloud-sends-only-the-first-one/78681/4 "2023-05-25T11:14:32Z")

</div>

Im having Node red locally on my computer and using MQTT out node to publish to Fogwing cloud

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [25 May 2023 12:18 UTC](https://discourse.nodered.org/t/problem-with-sending-multiple-jsons-to-cloud-sends-only-the-first-one/78681/5 "2023-05-25T12:18:54Z")

</div>

Try adding an MQTT-in node connected to a debug node (set to display the complete msg object) and see if you receive multiple messages in from the broker.

Did you look at MQTT explorer?

---

<div class="post-metadata">

**Author:** ![allienka](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allienka/32/79351_2.png) [@allienka](https://discourse.nodered.org/u/allienka)\
**Post date:** [26 May 2023 07:50 UTC](https://discourse.nodered.org/t/problem-with-sending-multiple-jsons-to-cloud-sends-only-the-first-one/78681/6 "2023-05-26T07:50:24Z")

</div>

> [@zenofmud](#):
>
> Try adding an MQTT-in node connected to a debug node (set to display the complete msg object) and see if you receive multiple messages in from the broker.

the debug node with MQTT in node doesnt seem to work. the connection settings are the same, topic Qos and Retain should be ok as well.. still in cloud is only the first json.

MQTT explorer keeps connecting and disconnecting, the connection settings are the same as in Node red.

 ![Screenshot 2023-05-26 104745](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/4/c413e03ac17cd27451e8c3e7d92acc56ae3908a8.png)

---

<div class="post-metadata">

**Author:** ![allienka](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allienka/32/79351_2.png) [@allienka](https://discourse.nodered.org/u/allienka)\
**Post date:** [26 May 2023 08:03 UTC](https://discourse.nodered.org/t/problem-with-sending-multiple-jsons-to-cloud-sends-only-the-first-one/78681/7 "2023-05-26T08:03:05Z")

</div>

now it worked! got all the data to the cloud, when I changed the port from 8883 to 1883...

---

<div class="post-metadata">

**Author:** ![allienka](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allienka/32/79351_2.png) [@allienka](https://discourse.nodered.org/u/allienka)\
**Post date:** [26 May 2023 11:44 UTC](https://discourse.nodered.org/t/problem-with-sending-multiple-jsons-to-cloud-sends-only-the-first-one/78681/8 "2023-05-26T11:44:34Z")

</div>

is it possible to use somehow the trigger node to inject every hour so that at the particular hour only the right json would be send to the cloud ?

---

<div class="post-metadata">

**Author:** ![allienka](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allienka/32/79351_2.png) [@allienka](https://discourse.nodered.org/u/allienka)\
**Post date:** [26 May 2023 11:46 UTC](https://discourse.nodered.org/t/problem-with-sending-multiple-jsons-to-cloud-sends-only-the-first-one/78681/9 "2023-05-26T11:46:48Z")

</div>

setting the inject for every hour..but how do I adjust the function

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [26 May 2023 13:57 UTC](https://discourse.nodered.org/t/problem-with-sending-multiple-jsons-to-cloud-sends-only-the-first-one/78681/10 "2023-05-26T13:57:59Z")

</div>

Why do you need to adjust the function if you are only getting a msg per hour?
