# Changing global variable inside the function node

**URL:** https://discourse.nodered.org/t/changing-global-variable-inside-the-function-node/8757
**Category:** General
**Created:** [8 March 2019 22:21 UTC](https://discourse.nodered.org/t/changing-global-variable-inside-the-function-node/8757 "2019-03-08T22:21:02Z")
**Posts on this page:** 1
**Showing post:** 33

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)
#### Post date: [13 March 2019 06:57 UTC](https://discourse.nodered.org/t/changing-global-variable-inside-the-function-node/8757/33 "2019-03-13T06:57:21Z")

</div>

Hi Petr,

Indeed it is possible to the functions `flowContext` and `globalContext`in a JSONata expression to get values from flow and global context. As far as I remember it is not possible to set values to the context via JSONata.

If you want to play with JSONata it is worth to [read this enlightening thread.](https://discourse.nodered.org/t/access-to-context-stores-in-jsonata-expressions/8738/8)

I don't think it is possible to use a JSONata expression in the change node in the way you illustrated above.

---

_[View the full topic](https://discourse.nodered.org/t/changing-global-variable-inside-the-function-node/8757)._
