# Json with hyphen

**URL:** <https://discourse.nodered.org/t/json-with-hyphen/31424>\
**Category:** General\
**Created:** [11 August 2020 05:21 UTC](https://discourse.nodered.org/t/json-with-hyphen/31424 "2020-08-11T05:21:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![spidgrou](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/spidgrou/32/27005_2.png) [@spidgrou](https://discourse.nodered.org/u/spidgrou)\
**Post date:** [11 August 2020 05:21 UTC](https://discourse.nodered.org/t/json-with-hyphen/31424/1 "2020-08-11T05:21:16Z")

</div>

I have an object coming from MQTT, inside the Json there is some hyphen and I'm not able to read it.  
I cannot understand where is my error.

```auto
[{"id":"6d828b17.342db4","type":"inject","z":"3c5213a5.c4284c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"StatusSNS\":{\"Time\":\"2020-08-11T06:08:13\",\"Switch2\":\"OFF\",\"BME280-76\":{\"Temperature\":25.1,\"Humidity\":56.9,\"DewPoint\":15.9,\"Pressure\":1003.5},\"BMP180-77\":{\"Temperature\":25.6,\"Pressure\":1006.9},\"PressureUnit\":\"hPa\",\"TempUnit\":\"C\"}}","payloadType":"json","x":280,"y":400,"wires":[["331405.e11e5bfc","267db1b0.6d05ee","34380528.ba27fa"]]},{"id":"331405.e11e5bfc","type":"debug","z":"3c5213a5.c4284c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":400,"wires":[]},{"id":"267db1b0.6d05ee","type":"change","z":"3c5213a5.c4284c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.StatusSNS.Switch2","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":440,"wires":[["331405.e11e5bfc"]]},{"id":"34380528.ba27fa","type":"change","z":"3c5213a5.c4284c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.StatusSNS[\"BME280-76\"].Temperature","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":480,"wires":[["331405.e11e5bfc"]]}]

```

Any help is welcome.

Thanks.  
Max

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [11 August 2020 05:26 UTC](https://discourse.nodered.org/t/json-with-hyphen/31424/2 "2020-08-11T05:26:39Z")

</div>

Set the change node to `msg.`, not expression.

---

<div class="post-metadata">

**Author:** ![spidgrou](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/spidgrou/32/27005_2.png) [@spidgrou](https://discourse.nodered.org/u/spidgrou)\
**Post date:** [11 August 2020 05:47 UTC](https://discourse.nodered.org/t/json-with-hyphen/31424/3 "2020-08-11T05:47:43Z")

</div>

Thanks bakman2!

---

<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:** [25 August 2020 05:47 UTC](https://discourse.nodered.org/t/json-with-hyphen/31424/4 "2020-08-25T05:47:49Z")

</div>

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