# Sending empty JSON array to custom namespace

**URL:** <https://forum.cirrus-link.com/t/sending-empty-json-array-to-custom-namespace/315>\
**Category:** Ignition Modules\
**Tags:** mqtt-engine\
**Created:** [March 10, 2023, 3:14am UTC](https://forum.cirrus-link.com/t/sending-empty-json-array-to-custom-namespace/315 "2023-03-10T03:14:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmisztur](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@cmisztur](https://forum.cirrus-link.com/u/cmisztur)\
**Post date:** [March 10, 2023, 3:14am UTC](https://forum.cirrus-link.com/t/sending-empty-json-array-to-custom-namespace/315/1 "2023-03-10T03:14:06Z")

</div>

I am sending the following payload to a custom namespace.

```auto
{
  "observation": {
    "time": 1678417316996,
    "machine": "f_sim_mqtt_long",
    "name": "alarms",
    "marker": [
      {
        "type": "path",
        "number": 1
      }
    ]
  },
  "state": {
    "time": 4306.0879,
    "data": {
      "alarms": [
        {
          "path": 1,
          "axis_code": 0,
          "axis": "",
          "number": 100,
          "message": "PARAMETER ENABLE SWITCH ONY",
          "type_code": 0,
          "type": "SW"
        }
      ]
    }
  }
}

```

Which comes across in tag browser as this:

 ![alm_ign](https://canada1.discourse-cdn.com/flex028/uploads/cirrus_link/original/1X/cc71a707adf2ce8d6df8e160206e5583d183f487.png)

However, after sending an empty array to $.state.data.alarms, the array is never cleared in the tag browser and no exceptions in the logs.

```auto
{
  "observation": {
    "time": 1678417363283,
    "machine": "f_sim_mqtt_long",
    "name": "alarms",
    "marker": [
      {
        "type": "path",
        "number": 1
      }
    ]
  },
  "state": {
    "time": 12921.8673,
    "data": {
      "alarms": []
    }
  }
}

```

Why is this?

---

<div class="post-metadata">

**Author:** ![wes.johnson](https://avatars.discourse-cdn.com/v4/letter/w/f14d63/32.png) [@wes.johnson](https://forum.cirrus-link.com/u/wes.johnson)\
**Post date:** [March 10, 2023, 3:43pm UTC](https://forum.cirrus-link.com/t/sending-empty-json-array-to-custom-namespace/315/2 "2023-03-10T15:43:55Z")

</div>

I’m not sure of the significance of the topic $.state.data.alarms. But, I’d guess it has some non-standard MQTT feature of your MQTT server? Regardless, MQTT Engine will not ever delete tags in a custom namespace automatically. If you want them deleted, it must be done manually or via a script.

---

<div class="post-metadata">

**Author:** ![cmisztur](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@cmisztur](https://forum.cirrus-link.com/u/cmisztur)\
**Post date:** [March 10, 2023, 4:11pm UTC](https://forum.cirrus-link.com/t/sending-empty-json-array-to-custom-namespace/315/3 "2023-03-10T16:11:47Z")

</div>

`$.state.data.alarms` was just a path to the delta of the payload.

What you are saying about not deleting tags in a custom namespace explains the behavior though.
