# Data storage not working with boolean values?

**URL:** <https://www.thethingsnetwork.org/forum/t/data-storage-not-working-with-boolean-values/37542>\
**Category:** Uncategorized\
**Created:** [June 3, 2020, 3:02pm UTC](https://www.thethingsnetwork.org/forum/t/data-storage-not-working-with-boolean-values/37542 "2020-06-03T15:02:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdesai-pg](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/sdesai-pg/32/25844_2.png) [@sdesai-pg](https://www.thethingsnetwork.org/forum/u/sdesai-pg)\
**Post date:** [June 3, 2020, 3:02pm UTC](https://www.thethingsnetwork.org/forum/t/data-storage-not-working-with-boolean-values/37542/1 "2020-06-03T15:02:19Z")

</div>

**Is it possible that data storage integration might have some issues storing records with null and/or boolean values?**

I have 2 applications. One with TTN node and its corresponding payload decoder. The second app has a tektelic device with motion sensor and its corresponding payload decoder.

Both of them are working fine and I can see data as expected in the real time traffic.

However, a strange thing happens with data storage integration.

The data storage integration works fine on TTN app and stores data as expected.

However, the data storage integration is not storing any data on the application with tektelic device. It is able to find the device but returns 404 when queried for data.

The only difference (I think) is that TekTelic sensor also transmits activity data which comes in either as true/false or null.

Could there be any other issue that I should look into?

Thanks.

---

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [June 3, 2020, 4:44pm UTC](https://www.thethingsnetwork.org/forum/t/data-storage-not-working-with-boolean-values/37542/2 "2020-06-03T16:44:05Z")

</div>

> [@sdesai-pg](#):
>
> It is able to find the device but returns 404 when queried for data.

404 or 204?

> [@Data Storage Integration Not working with TekTelic Sensor?](https://www.thethingsnetwork.org/forum/t/data-storage-integration-not-working-with-tektelic-sensor/37440/1):
>
> Now, when I try to fetch data […] from Swagger UI, it gives me 204 response. Meaning no data is available.

---

<div class="post-metadata">

**Author:** ![sdesai-pg](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/sdesai-pg/32/25844_2.png) [@sdesai-pg](https://www.thethingsnetwork.org/forum/u/sdesai-pg)\
**Post date:** [June 3, 2020, 4:44pm UTC](https://www.thethingsnetwork.org/forum/t/data-storage-not-working-with-boolean-values/37542/3 "2020-06-03T16:44:56Z")

</div>

My bad. it is showing 204.  
Sorry for that.

---

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [June 3, 2020, 4:49pm UTC](https://www.thethingsnetwork.org/forum/t/data-storage-not-working-with-boolean-values/37542/4 "2020-06-03T16:49:20Z")

</div>

Also, it seems it’s easily tested. A Decoder does not need to return details that are related to the payload, so you could test with things like:

```javascript
function Decoder(bytes, port) {
  switch(bytes[0]) {
    case 0x01:
      return {
        a: true,
        b: "string",
        c: 12.3
      };
    case 0x02:
      return {
        ...
      };
    ...
  }
}

```

And then use a device’s [Simulate uplink](https://www.thethingsnetwork.org/forum/t/how-can-i-test-my-application-by-means-of-seeing-the-data-at-my-http-integration/37334/2) to test.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [June 3, 2020, 9:40pm UTC](https://www.thethingsnetwork.org/forum/t/data-storage-not-working-with-boolean-values/37542/5 "2020-06-03T21:40:22Z")

</div>

> [@sdesai-pg](#):
>
> The only difference (I think) is that TekTelic sensor also transmits activity data which comes in either as true/false or null.

Presumably as numbers that the JS decodes - posting it would be useful.

Due to my error with configuring a test application I have four devices that send three different sorts of payloads between them. Those fields that aren’t applicable for a device are returned by the Data Storage as null without any issue. So checking the decoder script seems the best thing to look at.
