# Data Property Empty Error

**URL:** <https://forums.losant.com/t/data-property-empty-error/3900>\
**Category:** Help\
**Tags:** mqtt, workflow\
**Created:** [July 7, 2021, 7:53pm UTC](https://forums.losant.com/t/data-property-empty-error/3900 "2021-07-07T19:53:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jackson\_Miller](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Jackson\_Miller](https://forums.losant.com/u/Jackson_Miller)\
**Post date:** [July 7, 2021, 7:53pm UTC](https://forums.losant.com/t/data-property-empty-error/3900/1 "2021-07-07T19:53:19Z")

</div>

I am trying to connect an external mqtt server to losant. The mqtt node connects to my server. Then I have a JSON decode that converts the message from “data.message” to an “output” object and sends it to the device state node.

When the device runs I keep getting the following error:  
 ![MQTT Error 1](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/8/89eacd1b9eed63918de603e4c62984bf4f3e44a3.png)

Here is the device state tab showing that there are 7 attributes but only one I am connecting now to test functionality.

 ![MQTT Error Board Fields Overview](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/a/a2263da98129dc25489a3ee620a19d01a3b76feb.png)

Here is the MQTT packet info showing that there is data (even null) in the packet:  
 ![MQTT Error MQTT packet](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/f/fc74372468cda6fc4c62081761dd96ad15a9b466.png)

I don’t see why even if the data is null that it would not at least show up in the first screenshot with the keys in the MQTT packet and a value of null or zero.

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [July 7, 2021, 8:04pm UTC](https://forums.losant.com/t/data-property-empty-error/3900/2 "2021-07-07T20:04:14Z")

</div>

Hey @Jackson_Miller,

Welcome to the forums!

`null` is not automatically interpreted as 0 when reporting state. When `null` or `undefined` are reported as attributes, the values are ignored.

There are times when this behavior can be quite useful. You can have a single Device State Node reporting data for every attribute, even if the attributes aren’t on the payload. Any values that aren’t there are ignored. This prevents the requirement of having to check that every attribute exists before reporting them.

In your specific use case, you can use the `defaultTo` helper to report 0 if the value is `null` or `undefined`.

```nohighlight
{{defaultTo outputs.uFire_Mod-Flow_1.1 0}}

```

More details about this helper can be found in the [docs](https://docs.losant.com/workflows/accessing-payload-data/#format-helpers).

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [July 7, 2021, 8:12pm UTC](https://forums.losant.com/t/data-property-empty-error/3900/5 "2021-07-07T20:12:13Z")

</div>

Potentially related is that your object key has a special character in it: `1/min`. To reference this in a template, you’ll need to use square brackets:

```nohighlight
{{ output.uFire_Mod-Flow_1.[1/min] }}

```
