# Payload object with "-" in the name does not work

**URL:** <https://discourse.nodered.org/t/payload-object-with-in-the-name-does-not-work/16560>\
**Category:** General\
**Created:** [10 October 2019 15:49 UTC](https://discourse.nodered.org/t/payload-object-with-in-the-name-does-not-work/16560 "2019-10-10T15:49:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hubertus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hubertus/32/10077_2.png) [@Hubertus](https://discourse.nodered.org/u/Hubertus)\
**Post date:** [10 October 2019 15:49 UTC](https://discourse.nodered.org/t/payload-object-with-in-the-name-does-not-work/16560/1 "2019-10-10T15:49:52Z")

</div>

Hi all,

when i retrive the wps status from a Fritz!Box i get the payload:

{"NewX\_AVM-DE\_WPSMode":"stop","NewX\_AVM-DE\_WPSStatus":"err\_timeout"}

to display the values i have split node:

> var Mode = {payload: msg.payload.NewX\_AVM-DE\_WPSMode};  
> var Status = {payload: msg.payload.NewX\_AVM-DE\_WPSStatus};
> 
> return [Mode,Status];

here comes the error:

> ReferenceError: DE\_WPSMode is not defined (line 1, col 43)

the first part of the payload object is not read. Is there a option to rename the part of payload object or how to get the right value?

Thanks to all  
Hubertus

---

<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 October 2019 15:53 UTC](https://discourse.nodered.org/t/payload-object-with-in-the-name-does-not-work/16560/2 "2019-10-10T15:53:11Z")

</div>

When JavaScript sees `msg.payload.NewX_AVM-DE_WPSMode` it interprets it as:

```javascript
msg.payload.NewX_AVM - DE_WPSMode

```

In other words, it tries to subtract the value of the variable `DE_WPSMode` from `msg.payload.NewX_AVM`, but as `DE_WPSMode` doesn't exist, you get the error you see.

To access that object property, you'll have to use the alternative syntax:

```javascript
msg.payload["NewX_AVM-DE_WPSMode"]

```

---

<div class="post-metadata">

**Author:** ![Hubertus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hubertus/32/10077_2.png) [@Hubertus](https://discourse.nodered.org/u/Hubertus)\
**Post date:** [10 October 2019 15:57 UTC](https://discourse.nodered.org/t/payload-object-with-in-the-name-does-not-work/16560/3 "2019-10-10T15:57:18Z")

</div>

Hi knolleary,

thank you for the fast answer!  
it works! perfekt.
