# Output a very simple JSON object instead of a string?

**URL:** <https://discourse.nodered.org/t/output-a-very-simple-json-object-instead-of-a-string/84414>\
**Category:** General\
**Created:** [9 January 2024 10:37 UTC](https://discourse.nodered.org/t/output-a-very-simple-json-object-instead-of-a-string/84414 "2024-01-09T10:37:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [9 January 2024 10:58 UTC](https://discourse.nodered.org/t/output-a-very-simple-json-object-instead-of-a-string/84414/2 "2024-01-09T10:58:37Z")

</div>

> [@questuk](#):
>
> I receive in Node-RED one single object, so I cannot separate the value

what do you mean? Since it is an object, you can simply access the value using `msg.payload.name_of_property`

However, since you have chosen a god awful property name and awful topic structure, you are just making things difficult for yourself!

Recommendation:

1. structure your topics like `module/99/info/blahblah`
2. name properties in a way that doesnt require square bracket notation to access them. e.g. `current_temperature` instead of `22 - Current temperature =`

You will eventually realise the benefit of a good topic structure but until that moment of realisation, please take on board what we have suggested here and previously:

> [@How can I receive & send Data in Node-RED as JSON ... in a easy to understand way?](https://discourse.nodered.org/t/how-can-i-receive-send-data-in-node-red-as-json-in-a-easy-to-understand-way/84242/10):
>
> PS:
> 
> a better topic structure would be `module/22/xxxxx` this way you can subscribe to all modules `module/#` or a single module `module/22/#` or a specif topic of all modules `module/+/temperature`

---

_[View the full topic](https://discourse.nodered.org/t/output-a-very-simple-json-object-instead-of-a-string/84414)._
