# Don't know how to pull flow context without quotations in a template

**URL:** <https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563>\
**Category:** General\
**Created:** [26 May 2019 14:14 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563 "2019-05-26T14:14:06Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![NRdiscrs9393](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nrdiscrs9393/32/726_2.png) [@NRdiscrs9393](https://discourse.nodered.org/u/NRdiscrs9393)\
**Post date:** [26 May 2019 14:14 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563/1 "2019-05-26T14:14:06Z")

</div>

How might I setup this template node to pull flow.fmodeUpstairsSet without the " " marks in the payload?

Here's the template:  
{"fmode":"{{flow.fmodeUpstairsSet}}"}

 ![Capture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/8f90a8cde7e8cc6b29c5672638de3938d3a719bf.png)

`[{"id":"a5b99c87.21cf68","type":"inject","z":"5d29b44a.2f258c","name":"AUTO","topic":"","payload":"0","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":1260,"wires":[["e62db145.72aa5"]]},{"id":"479c9f32.5e7d98","type":"inject","z":"5d29b44a.2f258c","name":"AUTO/CIRCULATE","topic":"","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":188,"y":1304,"wires":[["e62db145.72aa5"]]},{"id":"ddaff9a8.85193","type":"inject","z":"5d29b44a.2f258c","name":"ON","topic":"","payload":"2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":148,"y":1344,"wires":[["e62db145.72aa5"]]},{"id":"e62db145.72aa5","type":"change","z":"5d29b44a.2f258c","name":"fmodeUpstairsSet","rules":[{"t":"set","p":"fmodeUpstairsSet","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":1260,"wires":[["f7c7e871.cc649"]]},{"id":"f7c7e871.cc649","type":"template","z":"5d29b44a.2f258c","name":"Tstat format","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\"fmode\":\"{{flow.fmodeUpstairsSet}}\"}","output":"json","x":750,"y":1260,"wires":[["39325305.8a42bc","a6ce4a77.9aff78"]]},{"id":"a6ce4a77.9aff78","type":"debug","z":"5d29b44a.2f258c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":910,"y":1320,"wires":[]}]`

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [26 May 2019 16:38 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563/2 "2019-05-26T16:38:44Z")

</div>

Errr ? maybe just remove them from the template ?

---

<div class="post-metadata">

**Author:** ![NRdiscrs9393](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nrdiscrs9393/32/726_2.png) [@NRdiscrs9393](https://discourse.nodered.org/u/NRdiscrs9393)\
**Post date:** [26 May 2019 16:56 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563/3 "2019-05-26T16:56:12Z")

</div>

I get a bad string error.

 ![200](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/0d5714b76c4ad21a9a8c19156e5e7c4a21a561dd.png)

---

<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:** [26 May 2019 17:04 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563/4 "2019-05-26T17:04:18Z")

</div>

That error is because you have it set to JSON syntax highlighting, which doesn't know about mustache syntax.

---

<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:** [26 May 2019 17:11 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563/5 "2019-05-26T17:11:45Z")

</div>

> [@NRdiscrs9393](#):
>
> How might I setup this template node to pull flow.fmodeUpstairsSet without the " " marks in the payload?
> 
> Here's the template:  
> {"fmode":"{{flow.fmodeUpstairsSet}}"}

To me it looks like you're just trying to make a JS object with a property named fmode set to the value of flow.fmodeUpstairsSet?

why not just use a function node?

```auto
var msg = {fmode: flow.get("fmodeUpstairsSet")}
return msg;

```

or a change node...  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/980fa5331141488d204a378873d7ce9e481ff217.png)

---

<div class="post-metadata">

**Author:** ![NRdiscrs9393](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nrdiscrs9393/32/726_2.png) [@NRdiscrs9393](https://discourse.nodered.org/u/NRdiscrs9393)\
**Post date:** [26 May 2019 19:02 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563/6 "2019-05-26T19:02:56Z")

</div>

I still get an error. It appear of how and where the fmode object is placed. It will only work by having the object under payload and without quotes around the value. Here is the curl command from the API

> $ curl -d '{"fmode":2}' [http://192.168.7.240/tstat](http://192.168.7.240/tstat)  
> {“success”: 0}

I've setup a flow with your suggestions along withe the associated debug.

 ![200](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/7a26175df77c4894a7530beedf7630dc86a09206.png)

Here's the Flow

```auto
[{"id":"a628c702.609358","type":"http request","z":"5d29b44a.2f258c","name":"","method":"POST","ret":"obj","url":"http://192.168.7.240/tstat","tls":"","x":1230,"y":680,"wires":[["99dd4025.6fd1b","c004beb3.3f29e"]]},{"id":"bfbf802b.a54658","type":"template","z":"5d29b44a.2f258c","name":"{\"fmode\":2}","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\"fmode\":2}","output":"json","x":970,"y":840,"wires":[["a628c702.609358","da227757.3a62c8"]]},{"id":"79e51d0c.be4bd4","type":"inject","z":"5d29b44a.2f258c","name":"inject","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":750,"y":980,"wires":[["599f6680.0d5188"]]},{"id":"a5b99c87.21cf68","type":"inject","z":"5d29b44a.2f258c","name":"AUTO","topic":"","payload":"0","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":750,"y":1080,"wires":[["e62db145.72aa5"]]},{"id":"479c9f32.5e7d98","type":"inject","z":"5d29b44a.2f258c","name":"AUTO/CIRCULATE","topic":"","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":788,"y":1124,"wires":[["e62db145.72aa5"]]},{"id":"ddaff9a8.85193","type":"inject","z":"5d29b44a.2f258c","name":"ON","topic":"","payload":"2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":748,"y":1164,"wires":[["e62db145.72aa5"]]},{"id":"e62db145.72aa5","type":"change","z":"5d29b44a.2f258c","name":"fmodeUpstairsSet","rules":[{"t":"set","p":"fmodeUpstairsSet","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":1080,"wires":[[]]},{"id":"99dd4025.6fd1b","type":"delay","z":"5d29b44a.2f258c","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1620,"y":680,"wires":[["26b5c9ed.41229e"]]},{"id":"599f6680.0d5188","type":"change","z":"5d29b44a.2f258c","name":"Set fmodeUpstairsSet","rules":[{"t":"set","p":"object","pt":"msg","to":"fmodeUpstairsSet","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":980,"wires":[["a628c702.609358","576cf85.e295b08"]]},{"id":"989eefbb.70d168","type":"function","z":"5d29b44a.2f258c","name":"var msg = {fmode: flow.get(\"fmodeUpstairsSet\")}","func":"var msg = {fmode: flow.get(\"fmodeUpstairsSet\")}\nreturn msg;","outputs":1,"noerr":0,"x":1090,"y":1020,"wires":[["a628c702.609358","549c4c27.1d3f6c"]]},{"id":"6d60e09a.cc56","type":"inject","z":"5d29b44a.2f258c","name":"inject","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":750,"y":1020,"wires":[["989eefbb.70d168"]]},{"id":"a2572035.7f37c8","type":"inject","z":"5d29b44a.2f258c","name":"inject","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":750,"y":840,"wires":[["bfbf802b.a54658"]]},{"id":"a982d857.98ca28","type":"template","z":"5d29b44a.2f258c","name":"{\"fmode\":\"{{flow.fmodeUpstairsSet}}\"}","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\"fmode\":\"{{flow.fmodeUpstairsSet}}\"}","output":"json","x":1050,"y":940,"wires":[["a628c702.609358","a4e28019.4f1d9"]]},{"id":"d2c6b866.3b9b18","type":"inject","z":"5d29b44a.2f258c","name":"inject","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":750,"y":940,"wires":[["a982d857.98ca28"]]},{"id":"e1b2eca4.c998c8","type":"comment","z":"5d29b44a.2f258c","name":"Working","info":"","x":960,"y":800,"wires":[]},{"id":"1cf3709d.bb4907","type":"comment","z":"5d29b44a.2f258c","name":"Not Working","info":"","x":970,"y":900,"wires":[]},{"id":"da227757.3a62c8","type":"debug","z":"5d29b44a.2f258c","name":"{\"fmode\":2}","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1390,"y":840,"wires":[]},{"id":"a4e28019.4f1d9","type":"debug","z":"5d29b44a.2f258c","name":"{\"fmode\":\"{{flow.tmodeUpstairsSet}}\"}","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1470,"y":920,"wires":[]},{"id":"576cf85.e295b08","type":"debug","z":"5d29b44a.2f258c","name":"Set fmodeUpstairsSet","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1420,"y":980,"wires":[]},{"id":"549c4c27.1d3f6c","type":"debug","z":"5d29b44a.2f258c","name":"var msg = {fmode: flow.get(\"fmodeUpstairsSet\")}","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1510,"y":1020,"wires":[]}]

```

Please forgive my ignorance on this and thank you for your patience. I'll be sure to contribute the complete flow for this project once I work out the bugs.

---

<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:** [26 May 2019 19:22 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563/7 "2019-05-26T19:22:28Z")

</div>

What is the inject sending to the function node? Put a debug on everything. You'll figure it out.

---

<div class="post-metadata">

**Author:** ![NRdiscrs9393](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nrdiscrs9393/32/726_2.png) [@NRdiscrs9393](https://discourse.nodered.org/u/NRdiscrs9393)\
**Post date:** [26 May 2019 19:51 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563/8 "2019-05-26T19:51:10Z")

</div>

The function created an error as shown above.  
What I don't know how to do it get the value of the fmode to the object of the payload without quotes. Here's a working version printed from debug. But I am limited to the number 2 instead of the variable.  
 ![200](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/9c1d247720ec9891619ebd5fe2d7427be265657f.png)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [26 May 2019 20:33 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563/9 "2019-05-26T20:33:42Z")

</div>

> [@How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506):
>
> To share code samples or flow json in this forum, you need to take care to format it properly so that it is displayed correctly. The easiest way to do that is to click the 'Preformatted Text' button in the toolbar: [image] Then paste in your code or flow json. You should end up with three back-tick characters - ``` - on their own line before and after the code. On standard US English keyboards, this is on the same key as the ~ character. Using the backticks will ens…

---

<div class="post-metadata">

**Author:** ![NRdiscrs9393](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nrdiscrs9393/32/726_2.png) [@NRdiscrs9393](https://discourse.nodered.org/u/NRdiscrs9393)\
**Post date:** [26 May 2019 20:44 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563/10 "2019-05-26T20:44:17Z")

</div>

Thank you. I've updated the post above with your recommendation.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [26 May 2019 21:51 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563/11 "2019-05-26T21:51:12Z")

</div>

export it again from node-red.

three backticks: `

```auto
code

```

three backticks: `

---

<div class="post-metadata">

**Author:** ![NRdiscrs9393](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nrdiscrs9393/32/726_2.png) [@NRdiscrs9393](https://discourse.nodered.org/u/NRdiscrs9393)\
**Post date:** [26 May 2019 22:12 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563/12 "2019-05-26T22:12:16Z")

</div>

done with the ``` Thanks

---

<div class="post-metadata">

**Author:** ![NRdiscrs9393](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nrdiscrs9393/32/726_2.png) [@NRdiscrs9393](https://discourse.nodered.org/u/NRdiscrs9393)\
**Post date:** [26 May 2019 23:10 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563/13 "2019-05-26T23:10:02Z")

</div>

I cleaned up the flow to improve testing and show the debug for each solution presented.

```auto
[{"id":"a628c702.609358","type":"http request","z":"5d29b44a.2f258c","name":"","method":"POST","ret":"obj","url":"http://192.168.7.240/tstat","tls":"","x":1650,"y":1020,"wires":[["99dd4025.6fd1b","c004beb3.3f29e"]]},{"id":"bfbf802b.a54658","type":"template","z":"5d29b44a.2f258c","name":"{\"fmode\":2}","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\"fmode\":0}","output":"json","x":970,"y":980,"wires":[["a628c702.609358","2c4ecd0d.e3871a"]]},{"id":"a5b99c87.21cf68","type":"inject","z":"5d29b44a.2f258c","name":"AUTO","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":750,"y":1140,"wires":[["e62db145.72aa5"]]},{"id":"ddaff9a8.85193","type":"inject","z":"5d29b44a.2f258c","name":"ON","topic":"","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":750,"y":1180,"wires":[["e62db145.72aa5"]]},{"id":"e62db145.72aa5","type":"change","z":"5d29b44a.2f258c","name":"fmodeUpstairsSet","rules":[{"t":"set","p":"fmodeUpstairsSet","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":1140,"wires":[["a982d857.98ca28"]]},{"id":"599f6680.0d5188","type":"change","z":"5d29b44a.2f258c","name":"Set fmodeUpstairsSet","rules":[{"t":"set","p":"fmode","pt":"msg","to":"fmodeUpstairsSet","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":1220,"wires":[["a628c702.609358","576cf85.e295b08"]]},{"id":"989eefbb.70d168","type":"function","z":"5d29b44a.2f258c","name":"var msg = {fmode: flow.get(\"fmodeUpstairsSet\")}","func":"var msg = {fmode: flow.get(\"fmodeUpstairsSet\")}\nreturn msg;","outputs":1,"noerr":0,"x":1270,"y":1260,"wires":[["a628c702.609358","549c4c27.1d3f6c"]]},{"id":"a2572035.7f37c8","type":"inject","z":"5d29b44a.2f258c","name":"AUTO","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":750,"y":980,"wires":[["bfbf802b.a54658"]]},{"id":"a982d857.98ca28","type":"template","z":"5d29b44a.2f258c","name":"{\"fmode\":\"{{flow.fmodeUpstairsSet}}\"}","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\"fmode\":\"{{flow.fmodeUpstairsSet}}\"}","output":"json","x":1230,"y":1180,"wires":[["a628c702.609358","a4e28019.4f1d9"]]},{"id":"e1b2eca4.c998c8","type":"comment","z":"5d29b44a.2f258c","name":"Working","info":"","x":960,"y":940,"wires":[]},{"id":"1cf3709d.bb4907","type":"comment","z":"5d29b44a.2f258c","name":"Not Working","info":"","x":970,"y":1100,"wires":[]},{"id":"da227757.3a62c8","type":"debug","z":"5d29b44a.2f258c","name":"{\"fmode\":2}","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1230,"y":1020,"wires":[]},{"id":"a4e28019.4f1d9","type":"debug","z":"5d29b44a.2f258c","name":"{\"fmode\":\"{{flow.tmodeUpstairsSet}}\"}","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1650,"y":1180,"wires":[]},{"id":"576cf85.e295b08","type":"debug","z":"5d29b44a.2f258c","name":"Set fmodeUpstairsSet","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1600,"y":1220,"wires":[]},{"id":"549c4c27.1d3f6c","type":"debug","z":"5d29b44a.2f258c","name":"var msg = {fmode: flow.get(\"fmodeUpstairsSet\")}","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1690,"y":1260,"wires":[]},{"id":"b0def615.782b48","type":"template","z":"5d29b44a.2f258c","name":"{\"fmode\":0}","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\"fmode\":2}","output":"json","x":970,"y":1020,"wires":[["a628c702.609358","da227757.3a62c8"]]},{"id":"8537bdbc.4363e","type":"inject","z":"5d29b44a.2f258c","name":"ON","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":750,"y":1020,"wires":[["b0def615.782b48"]]},{"id":"2c4ecd0d.e3871a","type":"debug","z":"5d29b44a.2f258c","name":"{\"fmode\":0}","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1230,"y":980,"wires":[]},{"id":"90d2c30a.5756d","type":"inject","z":"5d29b44a.2f258c","name":"AUTO","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":750,"y":1220,"wires":[["15e51fc6.be5b28"]]},{"id":"239c4ff9.ae037","type":"inject","z":"5d29b44a.2f258c","name":"ON","topic":"","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":750,"y":1260,"wires":[["15e51fc6.be5b28"]]},{"id":"15e51fc6.be5b28","type":"change","z":"5d29b44a.2f258c","name":"fmodeUpstairsSet","rules":[{"t":"set","p":"fmodeUpstairsSet","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":1220,"wires":[["599f6680.0d5188"]]},{"id":"ebe353a4.fbe03","type":"inject","z":"5d29b44a.2f258c","name":"AUTO","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":750,"y":1300,"wires":[["29e3ec7.2569d94"]]},{"id":"29e3ec7.2569d94","type":"change","z":"5d29b44a.2f258c","name":"fmodeUpstairsSet","rules":[{"t":"set","p":"fmodeUpstairsSet","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":1300,"wires":[["989eefbb.70d168"]]}]

```

---

<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:** [27 May 2019 00:07 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563/14 "2019-05-27T00:07:44Z")

</div>

> [@NRdiscrs9393](#):
>
> I cleaned up the flow to improve testing and show the debug for each solution presented.

Much better now. Well done. Now it is easier to provide some suggestions.

Check if the revised nodes work well now.

```auto
[{"id":"c23faefa.34bc7","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"2a694971.719046","type":"template","z":"c23faefa.34bc7","name":"{\"fmode\":2}","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\"fmode\":0}","output":"json","x":270,"y":100,"wires":[["e8c7847a.da2da8"]]},{"id":"3987e9df.770006","type":"inject","z":"c23faefa.34bc7","name":"AUTO","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":260,"wires":[["1ed828f8.624227"]]},{"id":"5c9f7e9f.87101","type":"inject","z":"c23faefa.34bc7","name":"ON","topic":"","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":300,"wires":[["1ed828f8.624227"]]},{"id":"1ed828f8.624227","type":"change","z":"c23faefa.34bc7","name":"fmodeUpstairsSet","rules":[{"t":"set","p":"fmodeUpstairsSet","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":250,"y":260,"wires":[["e3bbd124.13fee"]]},{"id":"b4c6bbed.4ed288","type":"change","z":"c23faefa.34bc7","name":"revised2","rules":[{"t":"set","p":"fmode","pt":"msg","to":"fmodeUpstairsSet","tot":"flow"},{"t":"set","p":"payload","pt":"msg","to":"{\"fmode\" : fmode}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":340,"wires":[["e9397e36.895ef"]]},{"id":"d4c51efd.e2ec6","type":"function","z":"c23faefa.34bc7","name":"revised3","func":"msg.payload = {fmode: flow.get(\"fmodeUpstairsSet\")}\n\nreturn msg;","outputs":1,"noerr":0,"x":450,"y":380,"wires":[["fc8df22b.a27"]]},{"id":"a6852b8d.66f828","type":"inject","z":"c23faefa.34bc7","name":"AUTO","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":90,"y":100,"wires":[["2a694971.719046"]]},{"id":"e3bbd124.13fee","type":"template","z":"c23faefa.34bc7","name":"revised1","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\"fmode\":{{flow.fmodeUpstairsSet}}}","output":"json","x":440,"y":300,"wires":[["7b867e.3d569984"]]},{"id":"856f0381.1e481","type":"comment","z":"c23faefa.34bc7","name":"Working","info":"","x":260,"y":60,"wires":[]},{"id":"cc9ebd54.c81ab","type":"comment","z":"c23faefa.34bc7","name":"???","info":"","x":250,"y":220,"wires":[]},{"id":"f27bcd77.2233","type":"debug","z":"c23faefa.34bc7","name":"{\"fmode\":2}","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":530,"y":140,"wires":[]},{"id":"7b867e.3d569984","type":"debug","z":"c23faefa.34bc7","name":"{\"fmode\":\"{{flow.tmodeUpstairsSet}}\"}","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":950,"y":300,"wires":[]},{"id":"e9397e36.895ef","type":"debug","z":"c23faefa.34bc7","name":"Set fmodeUpstairsSet","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":900,"y":340,"wires":[]},{"id":"fc8df22b.a27","type":"debug","z":"c23faefa.34bc7","name":"var msg = {fmode: flow.get(\"fmodeUpstairsSet\")}","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":990,"y":380,"wires":[]},{"id":"3905345a.2a600c","type":"template","z":"c23faefa.34bc7","name":"{\"fmode\":0}","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\"fmode\":2}","output":"json","x":270,"y":140,"wires":[["f27bcd77.2233"]]},{"id":"eca3a052.69663","type":"inject","z":"c23faefa.34bc7","name":"ON","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":90,"y":140,"wires":[["3905345a.2a600c"]]},{"id":"e8c7847a.da2da8","type":"debug","z":"c23faefa.34bc7","name":"{\"fmode\":0}","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":530,"y":100,"wires":[]},{"id":"7cdee0f1.f8aec","type":"inject","z":"c23faefa.34bc7","name":"AUTO","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":340,"wires":[["665cd1d7.28e1e"]]},{"id":"f1c5e8cb.c7c6b8","type":"inject","z":"c23faefa.34bc7","name":"ON","topic":"","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":380,"wires":[["665cd1d7.28e1e"]]},{"id":"665cd1d7.28e1e","type":"change","z":"c23faefa.34bc7","name":"fmodeUpstairsSet","rules":[{"t":"set","p":"fmodeUpstairsSet","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":250,"y":340,"wires":[["b4c6bbed.4ed288"]]},{"id":"9492797a.598f98","type":"inject","z":"c23faefa.34bc7","name":"AUTO","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":420,"wires":[["acab3ccc.91052"]]},{"id":"acab3ccc.91052","type":"change","z":"c23faefa.34bc7","name":"fmodeUpstairsSet","rules":[{"t":"set","p":"fmodeUpstairsSet","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":250,"y":420,"wires":[["d4c51efd.e2ec6"]]}]

```

Edit : below node should work too. It reads the value from flow context using JSONata.

```auto
[{"id":"53045596.a5f5bc","type":"change","z":"c23faefa.34bc7","name":"revised4","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"fmode\" : $flowContext(\"fmodeUpstairsSet\")}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":340,"wires":[["e9397e36.895ef"]]}]

```

Probably there are many other variations.

---

<div class="post-metadata">

**Author:** ![NRdiscrs9393](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nrdiscrs9393/32/726_2.png) [@NRdiscrs9393](https://discourse.nodered.org/u/NRdiscrs9393)\
**Post date:** [27 May 2019 00:52 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563/15 "2019-05-27T00:52:06Z")

</div>

All four variations worked!! Thank you. Thank you. I'll finish building out the rest of the API to work with Node Red to share with the forum.

Your help is appreciated.

---

<div class="post-metadata">

**Author:** ![NRdiscrs9393](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nrdiscrs9393/32/726_2.png) [@NRdiscrs9393](https://discourse.nodered.org/u/NRdiscrs9393)\
**Post date:** [28 May 2019 16:28 UTC](https://discourse.nodered.org/t/dont-know-how-to-pull-flow-context-without-quotations-in-a-template/11563/16 "2019-05-28T16:28:23Z")

</div>

I made good on my promise to pay it back. Here's the complete flow on the CT-50. Again... Thank you for your help.

> [@Radio Thermostat CT-50 CT-80 Wi-Fi USNAP Module API](https://discourse.nodered.org/t/radio-thermostat-ct-50-ct-80-wi-fi-usnap-module-api/11643):
>
> The Radio Thermostat API is an HTTP API that enables client programs to query the thermostat state, and to manage/control the thermostat operation. In the HTTP terminology, the thermostat will be a server that will respond to HTTP requests from client devices. The API is designed with a RESTful architecture in mind. [https://www.radiothermostat.com/](https://www.radiothermostat.com/) For sell at Amazon [https://www.amazon.com/gp/product/B00KQS35XA/](https://www.amazon.com/gp/product/B00KQS35XA/) I've setup a flow with the name Upstairs at the common thread for location. My in…
