# Handle json object

**URL:** <https://discourse.nodered.org/t/handle-json-object/101135>\
**Category:** General\
**Tags:** function-node\
**Created:** [26 May 2026 19:39 UTC](https://discourse.nodered.org/t/handle-json-object/101135 "2026-05-26T19:39:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![omni-support](https://avatars.discourse-cdn.com/v4/letter/o/eb9ed0/32.png) [@omni-support](https://discourse.nodered.org/u/omni-support)\
**Post date:** [26 May 2026 19:39 UTC](https://discourse.nodered.org/t/handle-json-object/101135/1 "2026-05-26T19:39:46Z")

</div>

hello,

I am pretty new to node-red, now I am working on one project which has mqtt json object as shown below:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/7/57ccc68c8b84a58e8a29d38fa3adbf04a1081135.png)

This object structure comes from 3rd party device, I can't change it, but I would like to change to my json object or javascript object, then I can easily build dashboard,

Please notify "data" is one array with different monitoring variables, I need extract them into different object or json object for easy operation.

Anybody knows how to do it?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [26 May 2026 19:47 UTC](https://discourse.nodered.org/t/handle-json-object/101135/2 "2026-05-26T19:47:55Z")

</div>

Well, we could help more if you were to describe more about what data structures you want to end up with.

I'm noting that the `data` properties are actually string representations of arrays. You can use a json node to convert those specific property values or you could use `msg.payload = JSON.parse(msg.payload.mqtt_data[0].data)`, etc. in a function node.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 May 2026 20:22 UTC](https://discourse.nodered.org/t/handle-json-object/101135/3 "2026-05-26T20:22:22Z")

</div>

> [@omni-support](#):
>
> This object structure comes from 3rd party device, I can't change it, but I would like to change to my json object or javascript object,

It isn't JSON, it is already a javascript object, though as @TotallyInformation points out, the `data` property is a JSON representation of an array, which can be converted to a js array in the way he describes.

---

<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:** [24 August 2026 20:22 UTC](https://discourse.nodered.org/t/handle-json-object/101135/4 "2026-08-24T20:22:44Z")

</div>

Closed on 24 August 2026 20:22 UTC

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