flow and global within mustache in template mode

1,020 views
Skip to first unread message

Stephen Wallace

unread,
Jan 30, 2016, 2:09:18 AM1/30/16
to Node-RED
Am I correct that there is no way to directly put the value from a global or flow object into the mustache braces in the template node?

I know that it can be done with an intermediate set node before the template node, but I am wondering if there is a way to access flow or global variables from within the template node.

Thanks,
Stephen

Dave C-J

unread,
Jan 30, 2016, 3:54:55 AM1/30/16
to node...@googlegroups.com
Hi,
the latest release (V0.13) does now include the ability to access them from the template node.
Inline images 1

Nicholas O'Leary

unread,
Jan 30, 2016, 4:42:28 AM1/30/16
to node...@googlegroups.com

To be clear, the template node lets you set a property under flow or global context.

It does not let you reference flow/global properties in the template itself, which is what I think you're asking. That's a slight oversight on my part and will be looking to address it. The tricky part, and why I didn't add it straight away, is that the properties in the template are assumed to be relative to the msg object. Will need some special handling to deal with properties under flow and global.

Nick


--
http://nodered.org
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dave C-J

unread,
Jan 30, 2016, 4:50:09 AM1/30/16
to node...@googlegroups.com
oops - sorry - my bad.​

Stephen Wallace

unread,
Jan 30, 2016, 12:05:13 PM1/30/16
to Node-RED
Thanks, that is what I thought.

I just upgraded to .13 yesterday.  I am loving the interface improvements --thanks!
Reply all
Reply to author
Forward
0 new messages