Question about template dashboard 2

On template is it possible to use global variable? How i can define?

The dashboard lives at the other side of the pipe called the socket. That pipe is used to send and receive messages containing the needed data between server side and dashboard. End of story.

You would copy the global variable to a message property prior to the template node.

Yes you can use a global variable in a Dashboard 2.0 Template. It's the same as Dashboard 1. You'll need to push it into the incoming message though. So technically it's nothing to do with the template node at all.

  1. Create a function node:

msg.payload = global.get("myVariable")

  1. Feed that into a template node, and display it on the dashboard using normal means:

{{msg.payload}}

1 Like