I can’t seem to access URL parameters in my simple webapp. From the documentation it looks very simple:
function doGet(e) {
var foo = (e.parameters.test);
return ContentService.createTextOutput("Test: " + foo);
}
But foo keeps coming back as “undefined” when I run the webapp, either using the “my latest code” developer link, or a deployed version.
I’ve also noticed that when the page loads the URL Parameters I tack on at the end disappear.
The URL looks like:
You should tack on the parameter before the script URL redirects.
So it should look like –
https://script.google.com/macros/s/longstring/exec?test=helloworld
The redirected URL is really only for the output and its not re-usable and it wont trigger any new processing.