Answer the question
In order to leave comments, you need to log in
How to call a function in the sidebar?
Hello.
How can I call a function from an html page that is in turn inserted into the sidebar's index.html page?
Answer the question
In order to leave comments, you need to log in
Call google apps script server function?
It's described here as:
https://developers.google.com/apps-script/guides/h...
function doGet() {
return HtmlService.createHtmlOutputFromFile('Index');
}
function doSomething() {
Logger.log('I was called!');
}
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<script>
google.script.run.doSomething();
</script>
</head>
<body>
</body>
</html>
withSuccessHandler(function)
google.script.run
.withSuccessHandler(function ( response ) {
console.info(response);
})
.withFailureHandler(function ( response ) {
console.error(response);
})
.doSomething();
let response = google.script.run.doSomething();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question