How to use msg.payload of a function into javascript?

I have a function that pulls information from a database, I've even saved it to a global variable.
The problem is that I don't know how to use this value in javascript, I have tried with global.get() but the console gives me an error because global is not declared as a variable.

I am attaching the script, the global variable is saved in "resultado", and I want to use it as "mensaje" inside js.

The template node is for templating text (primarily) for the browser. It uses mustache syntax (as the built in help states) to access msg and context values...

Use function node, if you want to code in JS.

The OP is writing client side code (note the use of document.getElementById)

But the first line is trying to get a value from the global context...

So this is going to need some pretty major redesign to get things to work...

Pretty sure {{global.myvar}} works in a template

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