I am able to capture a variable from the url of a published app script, but I am not sure how I can pass that variable to another function. The below script will not run the onRun function if a variable is included. My goal is to pass 2 variables, but one problem at a time.
function doGet(e) {
var id = e.parameter.id;
var minutes = e.parameter.min;
var html = '<p>'
+'<button onClick=google.script.run.onRun('+id+')>Run</button>' // Does not work when clicked
+'<button onClick=google.script.run.onRun()>Run without parameter</button>'
+'<button onClick=google.script.run.turnOn()>On</button>'
+'<button onClick=google.script.run.turnOff()>Off</button>'
+'</p>';
return HtmlService.createHtmlOutput(html).setSandboxMode(HtmlService.SandboxMode.IFRAME);
}
function onRun(id){
Logger.log("id: "+id);
}
Aucun commentaire:
Enregistrer un commentaire