# Payload message object key with a space?

**URL:** https://discourse.nodered.org/t/payload-message-object-key-with-a-space/47757
**Category:** General
**Created:** [28 June 2021 20:05 UTC](https://discourse.nodered.org/t/payload-message-object-key-with-a-space/47757 "2021-06-28T20:05:48Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)
#### Post date: [28 June 2021 20:05 UTC](https://discourse.nodered.org/t/payload-message-object-key-with-a-space/47757/1 "2021-06-28T20:05:49Z")

</div>

Payload message object key with a space? Got a python script that sends MQTT data and one of the keys in the resulting JavaScript object (via JSON) has spaces in the key string.

So, "System Up TIme: XXXXX" versus "SystemUpTime: XXXXX" for example. Space are legit apparently in key names, and JavaScript objects, but how does one qualify such in a change node?

msg.payload.System Up Time  
msg.payload."System Up Time"  
msg.payload["System Up Time"]

None of the above work?

Apparently you can do msg.payload["System Up Time"] in a functional node.

---

<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: [28 June 2021 20:20 UTC](https://discourse.nodered.org/t/payload-message-object-key-with-a-space/47757/2 "2021-06-28T20:20:59Z")

</div>

In a Change node, assuming you have set it to `msg` type, you can enter `payload["System Up Time"]`

---

<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: [28 June 2021 20:38 UTC](https://discourse.nodered.org/t/payload-message-object-key-with-a-space/47757/4 "2021-06-28T20:38:10Z")

</div>

> [@Nodi.Rubrum](#):
>
> but how does one qualify such in a change node

You use [copy path] button from the debug sidebar then paste it into the change node textbox

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

> **[Working with messages : Node-RED](https://nodered.org/docs/user-guide/messages)**

---

<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: [12 July 2021 20:38 UTC](https://discourse.nodered.org/t/payload-message-object-key-with-a-space/47757/5 "2021-07-12T20:38:32Z")

</div>

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