# Read out a global variable

**URL:** <https://discourse.nodered.org/t/read-out-a-global-variable/58879>\
**Category:** General\
**Created:** [23 February 2022 12:10 UTC](https://discourse.nodered.org/t/read-out-a-global-variable/58879 "2022-02-23T12:10:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Milanovic](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Milanovic](https://discourse.nodered.org/u/Milanovic)\
**Post date:** [23 February 2022 12:10 UTC](https://discourse.nodered.org/t/read-out-a-global-variable/58879/1 "2022-02-23T12:10:22Z")

</div>

Hi,

I am trying to read one specific value out of the global variable 'token'. But like you can see, the result is 'undefined'. So I think that the first lane isn't correct, can anyone help?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/c/5cd7ce60ed76bf5ea4521942c6685e721fde26e4.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/9/594224b42f3977564d3d1e7b524e4f330802672f.png)

---

<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:** [23 February 2022 12:23 UTC](https://discourse.nodered.org/t/read-out-a-global-variable/58879/2 "2022-02-23T12:23:53Z")

</div>

You are trying to read the global `TOKEN` but that is not a global variable you have defined. If you said `var VALUE = global.get("rfid") || []` you would get something back.  
You then use `VALUE.TOKEN` to access it’s contents.

P.s. why are you using a capital letters for variable names?

---

<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:** [24 April 2022 13:54 UTC](https://discourse.nodered.org/t/read-out-a-global-variable/58879/5 "2022-04-24T13:54:33Z")

</div>

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