I need to get information that is in a cell (F3), and insert it into a JS variable.
I know that to send variables from JS to AppScript it is through google.run.nomedafuncao()
However, in this case, the meaning would be the opposite. Can anyone help me?
In my example I have a variable called information = ss.getRange(6,3).getValue();
I want to get the data from the AppScript variable ‘information’, and pass it to the JS variable called ‘name’
I tried to send the information via JS, but without success.
2
Answers
To pass a variable from App Script to the client use
Where
value
is returned from the server functionnomedafuncao()
.To get an Apps Script variable and send it to JavaScript, you can use the google.script.run API, which allows you to communicate between your Google Apps Script code and the client-side JavaScript code (HTML/JavaScript).