Pull input data from template Node

I am trying to build a translate API.
My project includes an HTML page with JQUERY functions from the visual code.
I want to create an HTTP node that gets data from an input tag (string to translate in my page) and sends it to a google-translate node.
I do not succeed to pull the correct input from the user and sends it to another node.

What I need to use to do it and how??
Thanks, Asaf.

We need a little more context.

Is this a custom node that you are building or a user interface?

If it is a UI are you using Dashboard or uibuilder or some other ui node?

1 Like

Thanks.
I already try to use choice 2 but I didn't find any information on how I passed the current data that the user enters to input tag.
If I will send my project here, it will be more east to explain???

You have a couple of choices.

Firstly though, I assume that you can see how VueJS works with the input field in the default template? As it stands, that default doesn't do anything until you press the button but that is easily changed so that you action the input as soon as the user exits the field (for example, there are other things you can do of course if you want to - standard html/javascript stuff).

Also, a slight aside, if you aren't comfortable with using VueJS as a framework, you are free to use an alternative such as jQuery, REACT, Angular, etc. Or indeed to roll your own.

So, the choices:

  1. Interact with your API direct from the front end. In other words, use your front-end code to call the REST API directly.
  2. Interact with the API from Node-RED. Sending the user input back to node-red (see the button code in the default template) and using the resulting msg output from the uibuilder node to send into an http-request node, get the result, process it if needed and send it back to the front-end by passing it to the input of the uibuilder node.

Which you chose is up to you. I'd guess that 1. may be more efficient but harder to code.