# How do i write a function to obtain these objects

**URL:** <https://discourse.nodered.org/t/how-do-i-write-a-function-to-obtain-these-objects/69422>\
**Category:** General\
**Tags:** function-node\
**Created:** [22 October 2022 13:06 UTC](https://discourse.nodered.org/t/how-do-i-write-a-function-to-obtain-these-objects/69422 "2022-10-22T13:06:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![EidWanna](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@EidWanna](https://discourse.nodered.org/u/EidWanna)\
**Post date:** [22 October 2022 13:06 UTC](https://discourse.nodered.org/t/how-do-i-write-a-function-to-obtain-these-objects/69422/1 "2022-10-22T13:06:45Z")

</div>

How do i write a function to be able to read and display these specific readings?

 ![2022-10-22 21_00_08-Node-RED](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/c/fc19af9a0b860dd4a12a519f1b979bee841ab290.png)

---

<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:** [22 October 2022 13:19 UTC](https://discourse.nodered.org/t/how-do-i-write-a-function-to-obtain-these-objects/69422/2 "2022-10-22T13:19:39Z")

</div>

That looks like a JSON string, so start by feeding it through a JSON node to convert it to a javascript object. Then there is a great page in the docs ([Working with messages : Node-RED](https://nodered.org/docs/user-guide/messages)) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

![BX00Cy7yHi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

---

<div class="post-metadata">

**Author:** ![EidWanna](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@EidWanna](https://discourse.nodered.org/u/EidWanna)\
**Post date:** [22 October 2022 14:22 UTC](https://discourse.nodered.org/t/how-do-i-write-a-function-to-obtain-these-objects/69422/3 "2022-10-22T14:22:40Z")

</div>

![2022-10-22 22_21_15-Node-RED](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/a/9afdc03b3268ce8def3c2ef8cbcd2b8c9034b369.png)  
thank you so much - works like a dream

---

<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:** [5 November 2022 14:22 UTC](https://discourse.nodered.org/t/how-do-i-write-a-function-to-obtain-these-objects/69422/4 "2022-11-05T14:22:41Z")

</div>

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