# How to combine two data that do not arrive at the same time

**URL:** https://discourse.nodered.org/t/how-to-combine-two-data-that-do-not-arrive-at-the-same-time/44446
**Category:** Dashboard
**Created:** [20 April 2021 08:07 UTC](https://discourse.nodered.org/t/how-to-combine-two-data-that-do-not-arrive-at-the-same-time/44446 "2021-04-20T08:07:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![lyred](https://avatars.discourse-cdn.com/v4/letter/l/ccd318/32.png) [@lyred](https://discourse.nodered.org/u/lyred)
#### Post date: [20 April 2021 08:07 UTC](https://discourse.nodered.org/t/how-to-combine-two-data-that-do-not-arrive-at-the-same-time/44446/1 "2021-04-20T08:07:40Z")

</div>

Hello

I have a modbus node to receive the data of a sensor processed by a function and to store each in a variable in order to set up a msg.payload which collects these two data without problem  
**msg.payload = " RESUME : " + "temperature = " + temp + " °C || humidity = " + humi +" %" ;**

On the other hand, I have a ui\_Form or I mention an email address that will stoquer in msg.to to send the data collected by the sensor using the email node.  
**ex msg.to = "[exemple@gmail.com](mailto:exemple@gmail.com)"**

the sensor data comes in every 3 seconds, and the msg.to is generated every time I click on submit the problem I have is that I could not combine or associate the msg.payload with the msg.to to send the data via email, because they don’t come at the same time.

Any idea please !

 ![modbus_email](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/5/05c0035335e1499cc0071c3f0794af37173d0e49.png) sincerely

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [20 April 2021 08:09 UTC](https://discourse.nodered.org/t/how-to-combine-two-data-that-do-not-arrive-at-the-same-time/44446/2 "2021-04-20T08:09:41Z")

</div>

See [this article in the cookbook](https://cookbook.nodered.org/basic/join-streams) for an example of how to join messages into one object.

---

<div class="post-metadata">

### Author: ![lyred](https://avatars.discourse-cdn.com/v4/letter/l/ccd318/32.png) [@lyred](https://discourse.nodered.org/u/lyred)
#### Post date: [20 April 2021 08:46 UTC](https://discourse.nodered.org/t/how-to-combine-two-data-that-do-not-arrive-at-the-same-time/44446/3 "2021-04-20T08:46:10Z")

</div>

Thanks a lot, it work.

---

<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: [4 May 2021 08:46 UTC](https://discourse.nodered.org/t/how-to-combine-two-data-that-do-not-arrive-at-the-same-time/44446/4 "2021-05-04T08:46:14Z")

</div>

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