0

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:

https://script.googleusercontent.com/a/macros/mysite.com/echo?user_content_key=superlongstring&lib=otherstring&test=helloworld

1 Answer 1

4

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

enter image description here

The redirected URL is really only for the output and its not re-usable and it wont trigger any new processing.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.