# Node Red - insert

**URL:** <https://discourse.nodered.org/t/node-red-insert/67491>\
**Category:** Share Your Projects\
**Tags:** database, function-node\
**Created:** [8 September 2022 17:42 UTC](https://discourse.nodered.org/t/node-red-insert/67491 "2022-09-08T17:42:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dantekempfen](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@dantekempfen](https://discourse.nodered.org/u/dantekempfen)\
**Post date:** [8 September 2022 17:42 UTC](https://discourse.nodered.org/t/node-red-insert/67491/1 "2022-09-08T17:42:23Z")

</div>

Hi! I would need help on this matter. How do I differentiate the Var, so it does not take the same values ​​as shown in the attachment.

```auto
msg.fecha=new Date();
var fecha = msg.payload
var Tension1 = msg.payload
var Tension2 = msg.payload
var Tension3 = msg.payload
msg.topic = "INSERT INTO sepam(fecha,Tension1,Tension2,Tension3) VALUES (+'"+fecha+"',+ '"+Tension1+"',+'"+Tension2+"', +'"+Tension3+"')";
return msg;

```

 ![WhatsApp Image 2022-09-07 at 08.51.49](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/9/a99676c5b051a81c718698e400464be4749253d5.jpeg)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 September 2022 18:00 UTC](https://discourse.nodered.org/t/node-red-insert/67491/2 "2022-09-08T18:00:04Z")

</div>

Welcome to the forum @dantekempfen

You have set all three to the value of msg.payload, so they will all be the same. Are you sending multiple messages to the node and need to combine the data from those messages? If so then you can use a Join node for that. See [this article in the cookbook](https://cookbook.nodered.org/basic/join-streams) for an example of how to join messages into one object.

If the values are not coming from multiple messages then you need to give us more information.

---

<div class="post-metadata">

**Author:** ![dkempfen](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dkempfen/32/68062_2.png) [@dkempfen](https://discourse.nodered.org/u/dkempfen)\
**Post date:** [21 September 2022 03:59 UTC](https://discourse.nodered.org/t/node-red-insert/67491/3 "2022-09-21T03:59:32Z")

</div>

HI, @Colin!!! Yes, I need the VARs to be different so that it shows me three different messages. How can I do?

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [21 September 2022 08:38 UTC](https://discourse.nodered.org/t/node-red-insert/67491/4 "2022-09-21T08:38:32Z")

</div>

how are you getting the variables into your flow ? Source ?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 September 2022 20:02 UTC](https://discourse.nodered.org/t/node-red-insert/67491/5 "2022-09-21T20:02:38Z")

</div>

Did you look at the example link I posted?
