# Getting a value from a json property with space in the name

**URL:** https://discourse.nodered.org/t/getting-a-value-from-a-json-property-with-space-in-the-name/30904
**Category:** General
**Created:** [30 July 2020 00:12 UTC](https://discourse.nodered.org/t/getting-a-value-from-a-json-property-with-space-in-the-name/30904 "2020-07-30T00:12:49Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![douglassinji](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@douglassinji](https://discourse.nodered.org/u/douglassinji)
#### Post date: [30 July 2020 00:12 UTC](https://discourse.nodered.org/t/getting-a-value-from-a-json-property-with-space-in-the-name/30904/1 "2020-07-30T00:12:49Z")

</div>

Hi, Guys!

I'm receiving the JSON string below and converting it to a JavaScript Object.

```auto
{"electricFaultStamp":{"id":"Timed overcurrent relay fault","Ansi Code":51,"Flag":1,"Lock":0,"Time Stamp":"Thu Jan 1 00:16:10 1970"}}

```

Then, I'm using a function node to try to get and use the Time Stamp value using the code below:

```auto
var time = msg.payload.electricFaultStamp.Time Stamp; // I also tried (Time_Stamp)
msg.payload= time;
return msg;

```

but I was not able to get this value... Is it allowed to have a property name with space in the middle of the name in a Javascript object?

---

<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: [30 July 2020 00:17 UTC](https://discourse.nodered.org/t/getting-a-value-from-a-json-property-with-space-in-the-name/30904/2 "2020-07-30T00:17:13Z")

</div>

Take a look in the forums, something similar was just answered a short time ago.

---

<div class="post-metadata">

### Author: ![douglassinji](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@douglassinji](https://discourse.nodered.org/u/douglassinji)
#### Post date: [30 July 2020 00:19 UTC](https://discourse.nodered.org/t/getting-a-value-from-a-json-property-with-space-in-the-name/30904/3 "2020-07-30T00:19:28Z")

</div>

Tks... I've just found it on stackflow. I used:

```auto
var time = msg.payload.electricFaultStamp['Time Stamp'];

```

---

<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: [30 July 2020 09:35 UTC](https://discourse.nodered.org/t/getting-a-value-from-a-json-property-with-space-in-the-name/30904/4 "2020-07-30T09:35:45Z")

</div>

You can just grab the path from debug...

 ![dKt7AnQPPl](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/9/e9cdd6e3ba8cd1386463dabfac872bc63f7a81c8.gif)

---

<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: [13 August 2020 09:35 UTC](https://discourse.nodered.org/t/getting-a-value-from-a-json-property-with-space-in-the-name/30904/5 "2020-08-13T09:35:47Z")

</div>

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