Call function inside a template

I have a flow that is starting with an http node (GET), checking for the login, and if successful, I have some functions and rest api call (post) that are being run to retrieve some data. After that I display my data to the user using the template node (containing html and javascript)
what I want to achieve now is to run a new function / rest api call (or the previous function / rest api call of the flow) when a user is modifying an input on the screen.
Is this even possible? if so how can I do it? because right now I don't see a way to call a function using the template node.
I succeed to do something similar by refreshing the page (using some query in the url), but I would like to to that without refreshing (or changing) the page.

The template node itself is a simple "template" that can access msg variables, afaik it cannot do anything else.

If you are just using http-in/-out nodes to provide an endpoint, you may want to consider moving to uibuilder so that you can more easily add extra processing. uibuilder gives you a messaging interface that lets you easily send node-red messages into your front-end code and back again. It also has a (somewhat experimental) option to turn on server-side EJS templating which might also help.

1 Like