Send data from custom function to Javascript

24 views
Skip to first unread message

Tuan Do

unread,
Jan 17, 2022, 8:13:45 PM1/17/22
to Google Apps Script Community
I am wondering whether there is a way to send user input of my custom function to Javascript so that I can use it to do other stuff. I know how to send input from Javascript to Google App Script but could not find a way to do the other way. Appreciate any help

Radek Šimčík

unread,
Jan 18, 2022, 6:33:34 AM1/18/22
to Google Apps Script Community
not sure what you mean. If my answer does not help please provide code sample. You can use global variable https://www.w3schools.com/js/js_scope.asp


  var carName = "Volvo";
// code here can use carName

function myFunction() {
// code here can also use carName 
carName = user input
}

function myAnotherFunction() {
// code here can also use carName 
console.log(carName )
}

Radek
Reply all
Reply to author
Forward
0 new messages