I send parameter value from url to html in appsscript, but does not recognize it. I have trouble passing the value of a variable from a parameter in the url to a html appscript.
Could you please help me, I've tried everything and does not work. Show an example below
Url
https://script.google.com/a/<#######>/s/<script>/exec?clave=hola
Código.gs
function doGet(e) {
var template = HtmlService.createTemplateFromFile('Index');
template.clave=e.parameter.clave
return template.evaluate()
.setTitle('page')
.setSandboxMode(HtmlService.SandboxMode.IFRAME);
}
Index.html
<!DOCTYPE html>
<html>
<body>
<label for="id-cfolio" id="id-lfolio">field : </label><input type="text" size="6" id="id-cfolio" readonly />
</body>
</html>
JavaScript.html
$(document).ready(function(){
document.getElementById("id-cfolio").value = clave;
}