# Database not receive the data when one sensor stops

**URL:** <https://discourse.nodered.org/t/database-not-receive-the-data-when-one-sensor-stops/7824>\
**Category:** General\
**Created:** [11 February 2019 10:41 UTC](https://discourse.nodered.org/t/database-not-receive-the-data-when-one-sensor-stops/7824 "2019-02-11T10:41:05Z")\
**Posts on this page:** 1\
**Showing post:** 35

<div class="post-metadata">

**Author:** ![smalhao](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@smalhao](https://discourse.nodered.org/u/smalhao)\
**Post date:** [14 February 2019 09:56 UTC](https://discourse.nodered.org/t/database-not-receive-the-data-when-one-sensor-stops/7824/35 "2019-02-14T09:56:54Z")

</div>

I use this thread. I testing another way for my problem but i still in the same, the way i´m used is this:

 ![image.png](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/959d27465eb92de2c680919ac9bdee5d1a349dee.png)

My function is programmed like this:

```auto
if (typeof msg.payload === 'number') {
    msg.payload = true;
} else {
    msg.payload= false;
}
return msg;

```

When I run the program this gives me the following values ​​of msg.payload:

```auto
14/02/2019, 09:45:01[node: test function](http://10.6.4.101:1880/#)ns=2;s=SensorIndutivo : msg.payload : boolean
true

14/02/2019, 09:45:01[node: value received](http://10.6.4.101:1880/#)ns=2;s=SensorIndutivo : msg.payload : number
32.82964323001333

```

in the dasboard the led when it is true is green but when the sensor stops sending data it does not turn red (value false). The msg.payload of value received when sensor stops not send any value and not turn to red.

---

_[View the full topic](https://discourse.nodered.org/t/database-not-receive-the-data-when-one-sensor-stops/7824)._
