# Context variable not displayed in sidebar when set to undefined

**URL:** https://discourse.nodered.org/t/context-variable-not-displayed-in-sidebar-when-set-to-undefined/12622
**Category:** General
**Created:** [26 June 2019 16:20 UTC](https://discourse.nodered.org/t/context-variable-not-displayed-in-sidebar-when-set-to-undefined/12622 "2019-06-26T16:20:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![thatcadguy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thatcadguy/32/5273_2.png) [@thatcadguy](https://discourse.nodered.org/u/thatcadguy)
#### Post date: [26 June 2019 16:20 UTC](https://discourse.nodered.org/t/context-variable-not-displayed-in-sidebar-when-set-to-undefined/12622/1 "2019-06-26T16:20:52Z")

</div>

Hi, I have an inject block hooked up to a function block with "global.set('abc', undefined);", and abc never shows up in the context data sidebar. Is undefined not a valid value to use with context?

---

<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: [26 June 2019 16:23 UTC](https://discourse.nodered.org/t/context-variable-not-displayed-in-sidebar-when-set-to-undefined/12622/2 "2019-06-26T16:23:38Z")

</div>

> [@thatcadguy](#):
>
> Is undefined not a valid value to use with context?

Correct. Setting it to `undefined` will delete it from the store.

---

<div class="post-metadata">

### Author: ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)
#### Post date: [26 June 2019 16:24 UTC](https://discourse.nodered.org/t/context-variable-not-displayed-in-sidebar-when-set-to-undefined/12622/3 "2019-06-26T16:24:00Z")

</div>

See this thread: [Delete persistent flow context variable](https://discourse.nodered.org/t/delete-persistent-flow-context-variable/3121/6) It reveals all the secrets of context variable manipulations 🙂

---

<div class="post-metadata">

### Author: ![thatcadguy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thatcadguy/32/5273_2.png) [@thatcadguy](https://discourse.nodered.org/u/thatcadguy)
#### Post date: [26 June 2019 16:33 UTC](https://discourse.nodered.org/t/context-variable-not-displayed-in-sidebar-when-set-to-undefined/12622/4 "2019-06-26T16:33:08Z")

</div>

Understood, thanks. At first I did not understand why, but I imagine you have value with a default parameter value of undefined -- have to use something in order to do set with no value parameter given. It would be nice to have undefined and have a separate delete method, but a little late for that I imagine -- would break tons of code now.

---

<div class="post-metadata">

### Author: ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)
#### Post date: [26 June 2019 17:06 UTC](https://discourse.nodered.org/t/context-variable-not-displayed-in-sidebar-when-set-to-undefined/12622/5 "2019-06-26T17:06:00Z")

</div>

In your case I would use `null` to express the fact that the context variable is existing, but has no value set yet.
