# There is a way to see a global variable on flow?

**URL:** <https://discourse.nodered.org/t/there-is-a-way-to-see-a-global-variable-on-flow/45399>\
**Category:** General\
**Created:** [9 May 2021 21:04 UTC](https://discourse.nodered.org/t/there-is-a-way-to-see-a-global-variable-on-flow/45399 "2021-05-09T21:04:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![GiovanniG](https://avatars.discourse-cdn.com/v4/letter/g/ecd19e/32.png) [@GiovanniG](https://discourse.nodered.org/u/GiovanniG)\
**Post date:** [9 May 2021 21:04 UTC](https://discourse.nodered.org/t/there-is-a-way-to-see-a-global-variable-on-flow/45399/1 "2021-05-09T21:04:20Z")

</div>

Hi, Iim having issue and difficultied to debug it, it would be lovely to see the content on variable on flow. Since the "status" of a module is a dynamic variable.. I suppose it can be diplayed also that (if it is not long..)  
Any other alternative?  
Thank you

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [9 May 2021 22:24 UTC](https://discourse.nodered.org/t/there-is-a-way-to-see-a-global-variable-on-flow/45399/2 "2021-05-09T22:24:30Z")

</div>

You can use a JSONate expression in the debug node, and display it in the node status(limit 32 chars).`$flowContext("flow_var.property")` or globalContext().

---

<div class="post-metadata">

**Author:** ![GiovanniG](https://avatars.discourse-cdn.com/v4/letter/g/ecd19e/32.png) [@GiovanniG](https://discourse.nodered.org/u/GiovanniG)\
**Post date:** [9 May 2021 22:31 UTC](https://discourse.nodered.org/t/there-is-a-way-to-see-a-global-variable-on-flow/45399/3 "2021-05-09T22:31:00Z")

</div>

thanks, glad there is one 🙂 I've placed a dubug node near, choosen J expression and typed globalContext(Salotto)  
Then I connect the wire to the event output, but I have an error: "Invalid JSONata expression: globalContext(Salotto)"

---

<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:** [9 May 2021 22:44 UTC](https://discourse.nodered.org/t/there-is-a-way-to-see-a-global-variable-on-flow/45399/4 "2021-05-09T22:44:37Z")

</div>

> [@GiovanniG](#):
>
> "Invalid JSONata expression: globalContext(Salotto)"

Is Salotto the name of the global variable? If so, the try `$globalContext("Salotto")`

Note, the name is case sensitive

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [9 May 2021 22:46 UTC](https://discourse.nodered.org/t/there-is-a-way-to-see-a-global-variable-on-flow/45399/5 "2021-05-09T22:46:38Z")

</div>

Try `$globalContext("Salotto")`

---

<div class="post-metadata">

**Author:** ![GiovanniG](https://avatars.discourse-cdn.com/v4/letter/g/ecd19e/32.png) [@GiovanniG](https://discourse.nodered.org/u/GiovanniG)\
**Post date:** [9 May 2021 23:38 UTC](https://discourse.nodered.org/t/there-is-a-way-to-see-a-global-variable-on-flow/45399/6 "2021-05-09T23:38:22Z")

</div>

Thanks to all, works, I see it in debug window 🙂  
I did remember about the status node and I implemented it, I prefer, for example:  
node.status({fill:"green",shape:"dot",text:global.get(intensity)})

---

<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:** [8 July 2021 23:38 UTC](https://discourse.nodered.org/t/there-is-a-way-to-see-a-global-variable-on-flow/45399/7 "2021-07-08T23:38:40Z")

</div>

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