# How to access context and do maths with a change node?

**URL:** <https://discourse.nodered.org/t/how-to-access-context-and-do-maths-with-a-change-node/59363>\
**Category:** General\
**Created:** [4 March 2022 13:34 UTC](https://discourse.nodered.org/t/how-to-access-context-and-do-maths-with-a-change-node/59363 "2022-03-04T13:34:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [4 March 2022 13:34 UTC](https://discourse.nodered.org/t/how-to-access-context-and-do-maths-with-a-change-node/59363/1 "2022-03-04T13:34:40Z")

</div>

(Yes, I know... I've asked before.)

I've forgotten and can't remember any key words to search, so I have to ask.

I know I have to set the _mode_ to the `J` (closest I can get to what the symbol is) but I can't remember the magic syntax for either flow or global variables.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [4 March 2022 13:42 UTC](https://discourse.nodered.org/t/how-to-access-context-and-do-maths-with-a-change-node/59363/2 "2022-03-04T13:42:52Z")

</div>

Found it - typically after I posted the question:

`$flowContext("name")`

---

<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:** [4 March 2022 13:49 UTC](https://discourse.nodered.org/t/how-to-access-context-and-do-maths-with-a-change-node/59363/3 "2022-03-04T13:49:18Z")

</div>

> [@Trying\_to\_learn](#):
>
> I can't remember the magic syntax for either flow or global variables.

You dont have to remember Andrew, its in the list of functions...

![chrome_EYL7b3myF0](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/b/0bfd154dc454937f4967679066ab3ff6f9c0a348.gif)

Or if you are using monaco editor, start typing, pick from list...

![chrome_4YpNaqUWXN](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/4/14eb7daed3057e7318974f7b95bf05c59f7631e5.gif)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [4 March 2022 13:51 UTC](https://discourse.nodered.org/t/how-to-access-context-and-do-maths-with-a-change-node/59363/4 "2022-03-04T13:51:31Z")

</div>

After a lot of digging I did find/remember it.

The _Problem_ with what you suggest is that I have to have SOME knowledge of the commands.

Otherwise it is a tedious search through all the commands to remember the one I want.  
Brain failure sucks big time.

But thanks.

---

<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:** [4 March 2022 13:54 UTC](https://discourse.nodered.org/t/how-to-access-context-and-do-maths-with-a-change-node/59363/5 "2022-03-04T13:54:11Z")

</div>

> [@Trying\_to\_learn](#):
>
> The _Problem_ with what you suggest is that I have to have SOME knowledge of the commands.

you knew you were looking for something to do with context. So just start typing (works in monaco editor)

![chrome_dxEu3kfDpZ](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/c/0cee098311e196246c6e08f4cffada8ff25bfd46.gif)

no excuses. just try 🙂

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [4 March 2022 13:59 UTC](https://discourse.nodered.org/t/how-to-access-context-and-do-maths-with-a-change-node/59363/6 "2022-03-04T13:59:34Z")

</div>

Well, that is kind of how I did it.

As I said: serious brain failure.

I have found another big bug with something I wrote and am now _back peddling_ to fix that mistake.  
(Ah, what's life with out some mistakes?) 😉

---

<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:** [18 March 2022 14:00 UTC](https://discourse.nodered.org/t/how-to-access-context-and-do-maths-with-a-change-node/59363/7 "2022-03-18T14:00:31Z")

</div>

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