# How to set context variables containing spaces?

**URL:** https://discourse.nodered.org/t/how-to-set-context-variables-containing-spaces/14576
**Category:** General
**Created:** [21 August 2019 02:26 UTC](https://discourse.nodered.org/t/how-to-set-context-variables-containing-spaces/14576 "2019-08-21T02:26:23Z")
**Posts on this page:** 3
**Page:** 2

<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: [14 December 2022 14:24 UTC](https://discourse.nodered.org/t/how-to-set-context-variables-containing-spaces/14576/21 "2022-12-14T14:24:05Z")

</div>

Would it not be better to change the friendly names so they don't contain special characters? Otherwise, if the device fails, you will have to change all your flows when you fit a new device, rather than just configuring the original friendly name in Zigbee2MQTT.

---

<div class="post-metadata">

### Author: ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)
#### Post date: [14 December 2022 18:01 UTC](https://discourse.nodered.org/t/how-to-set-context-variables-containing-spaces/14576/22 "2022-12-14T18:01:59Z")

</div>

Not sure what the problem is. I use spaces in all my zigbee2MQTT friendly names and I haven't had any problems in over a year. All data goes via MQTT and they are used as a topic in many places in my flows.

They are also used as the device name in my device Objects (as in device['Smart Socket 01'] : {} ) [The IEEE address is used as the zigbee device ID which is part of the Object].

I think I did originally use \_ (underscores) but did some trials and the spaces never gave me an issue. (famous last words - but..)

---

<div class="post-metadata">

### Author: ![dokwon](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@dokwon](https://discourse.nodered.org/u/dokwon)
#### Post date: [15 December 2022 10:49 UTC](https://discourse.nodered.org/t/how-to-set-context-variables-containing-spaces/14576/23 "2022-12-15T10:49:25Z")

</div>

Yes, I didn't think of that. You're right!

[Previous page](https://discourse.nodered.org/t/how-to-set-context-variables-containing-spaces/14576.md?page=1)
