# Send data from VL53L0X to SQLite Database

**URL:** <https://discourse.nodered.org/t/send-data-from-vl53l0x-to-sqlite-database/52309>\
**Category:** General\
**Tags:** node-red-dashboard, database\
**Created:** [16 October 2021 20:42 UTC](https://discourse.nodered.org/t/send-data-from-vl53l0x-to-sqlite-database/52309 "2021-10-16T20:42:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RackBoy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rackboy/32/47595_2.png) [@RackBoy](https://discourse.nodered.org/u/RackBoy)\
**Post date:** [16 October 2021 20:42 UTC](https://discourse.nodered.org/t/send-data-from-vl53l0x-to-sqlite-database/52309/1 "2021-10-16T20:42:30Z")

</div>

Hi everyone. I've four VL53L0X sensors (on Raspberry Pi 4) and I've been trying to send their values into a SQLite database, but these values are exchanging between rows for every loop, like this:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/8/08408dcd6f725cc348bb95e35ba200bc38a8f783.png)

The second column's ok, but in the third one, the values are from two different sensors. I'm quiet frustrated about it.

Here's my code in a function node:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/e/8e105dfc038589d09e25c36cbed60b7b0d46c425.png)

The fixed values (like 27 and 1018) are supposed to be from the additional sensors.

In SQLite node:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/c/1c87159f9157e10398067be2c9296e77fbb22b2a.png)

And these are my nodes:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/e/3e6ae02a7010e0a29dee903281b98bbc243d1a4c.png)

I disconnected the others 3 nodes because of the problem shown in the first image. I need to upload the four values at once and I haven't could yet. By the way, thanks and sorry about my English, it ain't my first language.

I'll appreciate any ideas and help.

---

<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:** [17 October 2021 09:27 UTC](https://discourse.nodered.org/t/send-data-from-vl53l0x-to-sqlite-database/52309/2 "2021-10-17T09:27:08Z")

</div>

If I understand correctly you need to merge the four values together into one message before sending to sqlite. For this you can use the Join node in key/value pairs mode.

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:** ![RackBoy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rackboy/32/47595_2.png) [@RackBoy](https://discourse.nodered.org/u/RackBoy)\
**Post date:** [23 October 2021 20:38 UTC](https://discourse.nodered.org/t/send-data-from-vl53l0x-to-sqlite-database/52309/3 "2021-10-23T20:38:37Z")

</div>

I'll try that way, thanks.

---

<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:** [22 December 2021 20:39 UTC](https://discourse.nodered.org/t/send-data-from-vl53l0x-to-sqlite-database/52309/4 "2021-12-22T20:39:08Z")

</div>

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