# How to extract values from an Object?

**URL:** <https://discourse.nodered.org/t/how-to-extract-values-from-an-object/22944>\
**Category:** General\
**Created:** [10 March 2020 20:07 UTC](https://discourse.nodered.org/t/how-to-extract-values-from-an-object/22944 "2020-03-10T20:07:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Golonder](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@Golonder](https://discourse.nodered.org/u/Golonder)\
**Post date:** [10 March 2020 20:07 UTC](https://discourse.nodered.org/t/how-to-extract-values-from-an-object/22944/1 "2020-03-10T20:07:57Z")

</div>

Could you please help me to find out how to get data from an object with variables with special signs ?

```auto
msg.payload = msg.payload.SDS0X1."PM2.5";
msg.payload = msg.payload.SDS0X1.[PM2.5];
msg.payload = msg.payload.SDS0X1.'PM2.5';
return msg;

```

none of these works ...

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 March 2020 20:35 UTC](https://discourse.nodered.org/t/how-to-extract-values-from-an-object/22944/2 "2020-03-10T20:35:04Z")

</div>

Without knowing what the data looks like, it will be hard to help you.

Connect a debug node to what ever is giving you the data. Then open all the levels of the object and paste it to a reply.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [10 March 2020 20:44 UTC](https://discourse.nodered.org/t/how-to-extract-values-from-an-object/22944/3 "2020-03-10T20:44:09Z")

</div>

Maybe try `msg.payload = msg.payload.SDS0X1["PM2.5"];`  
you either use `.` or `[" "]`

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [10 March 2020 23:03 UTC](https://discourse.nodered.org/t/how-to-extract-values-from-an-object/22944/4 "2020-03-10T23:03:54Z")

</div>

Hi @Golonder

[This page in the docs](https://nodered.org/docs/user-guide/messages) shows how you can use the Debug sidebar to find out the path to any element of a message. It will give you the properly formatted expression to access the property.

---

<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:** [9 May 2020 23:03 UTC](https://discourse.nodered.org/t/how-to-extract-values-from-an-object/22944/5 "2020-05-09T23:03:55Z")

</div>

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