# JASONata $flowcontext can't get it working

**URL:** https://discourse.nodered.org/t/jasonata-flowcontext-cant-get-it-working/35696
**Category:** General
**Created:** [10 November 2020 20:41 UTC](https://discourse.nodered.org/t/jasonata-flowcontext-cant-get-it-working/35696 "2020-11-10T20:41:10Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![nonix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nonix/32/31739_2.png) [@nonix](https://discourse.nodered.org/u/nonix)
#### Post date: [10 November 2020 20:41 UTC](https://discourse.nodered.org/t/jasonata-flowcontext-cant-get-it-working/35696/1 "2020-11-10T20:41:10Z")

</div>

Hi guys, 'm not sure if I am doing something wrong, but I can't get this simple flow to work:

```auto
[{"id":"c1d0123d.36c56","type":"inject","z":"e4a2b71d.443e78","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":400,"y":660,"wires":[["980deed6.2c72a8"]]},{"id":"7a7a6264.84f094","type":"debug","z":"e4a2b71d.443e78","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":860,"y":680,"wires":[]},{"id":"980deed6.2c72a8","type":"change","z":"e4a2b71d.443e78","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$flowcontext(\"calibV0\")\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":660,"wires":[["7a7a6264.84f094"]]}]

```

The error received: _Invalid JSONata expression: Attempted to invoke a non-function_

Node.js version: Node v12.19.0  
NR version: 1.2.3  
OS: Raspbian 10 (buster)

Please accept my apology if this is not the right place and/or the q is too trivial 😳  
Thank you,  
N.

---

<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: [10 November 2020 20:49 UTC](https://discourse.nodered.org/t/jasonata-flowcontext-cant-get-it-working/35696/2 "2020-11-10T20:49:00Z")

</div>

Hi @nonix - welcome to the forum

> [@nonix](#):
>
> Please accept my apology if this is not the right place and/or the q is too trivial

No need to apologise - this is the right place to ask questions and there's nothing too trivial to ask when you're stuck on something.

The function you want is `$flowContext` not `$flowcontext`.

---

<div class="post-metadata">

### Author: ![nonix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nonix/32/31739_2.png) [@nonix](https://discourse.nodered.org/u/nonix)
#### Post date: [10 November 2020 21:06 UTC](https://discourse.nodered.org/t/jasonata-flowcontext-cant-get-it-working/35696/3 "2020-11-10T21:06:47Z")

</div>

> [@knolleary](#):
>
> `$flowContext`

Hi, thank you for super fast reply, did not realized it is case sensitive. 😊  
However, now there is no error msg, but nothing get set anyway. e.g. it sends an empty object.

```auto
[{"id":"aaa6fba3.dd4dc","type":"inject","z":"e4a2b71d.443e78","name":"LiPo calib. Voltage/A0","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0.00496173469387755102040816326531","payloadType":"num","x":420,"y":640,"wires":[["e7d50e70.2b49e"]]},{"id":"e7d50e70.2b49e","type":"change","z":"e4a2b71d.443e78","name":"","rules":[{"t":"set","p":"cailbV0","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":640,"wires":[[]]},{"id":"88b6d266.404a48","type":"change","z":"e4a2b71d.443e78","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$flowContext(\"calibV0\",\"memory\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":700,"wires":[["95689049.42786"]]},{"id":"95689049.42786","type":"debug","z":"e4a2b71d.443e78","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":770,"y":700,"wires":[]},{"id":"322d2a26.64ba0e","type":"inject","z":"e4a2b71d.443e78","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":360,"y":700,"wires":[["88b6d266.404a48"]]}]

```

I have also added the creation of the flow.context variable into this example.

Note: Not sure if any value, but need to say I have upgraded the NR from an older version (don't remember the previous ver. but about 1/2 year old)

Thank you for helping,  
N.

---

<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: [10 November 2020 21:12 UTC](https://discourse.nodered.org/t/jasonata-flowcontext-cant-get-it-working/35696/4 "2020-11-10T21:12:39Z")

</div>

You have a typo  
calibV0  
cailbV0

---

<div class="post-metadata">

### Author: ![nonix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nonix/32/31739_2.png) [@nonix](https://discourse.nodered.org/u/nonix)
#### Post date: [10 November 2020 21:22 UTC](https://discourse.nodered.org/t/jasonata-flowcontext-cant-get-it-working/35696/5 "2020-11-10T21:22:27Z")

</div>

> [@E1cid](#):
>
> cailbV0

Well, what can I say ... thank you very much for finding my typo.

I am so embarrassed 🤕

N.

---

<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: [10 November 2020 21:23 UTC](https://discourse.nodered.org/t/jasonata-flowcontext-cant-get-it-working/35696/6 "2020-11-10T21:23:11Z")

</div>

> [@nonix](#):
>
> did not realized it is case sensitive

Hi. Welcome to the forum.

JavaScript, JSON & JSONata are all 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: [10 November 2020 21:37 UTC](https://discourse.nodered.org/t/jasonata-flowcontext-cant-get-it-working/35696/7 "2020-11-10T21:37:34Z")

</div>

Don't fret to much we have all been there.

---

<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 November 2020 21:37 UTC](https://discourse.nodered.org/t/jasonata-flowcontext-cant-get-it-working/35696/8 "2020-11-24T21:37:36Z")

</div>

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