I am trying to access the HTTP GET variables in a Google Apps Script (Like PHPs $_GET). I tried several techniques:
Plain java script (window.location), which obviously is not supported
Googles own Service through SitesApp.getActivePage().getUrl(). Gives me the URL, but without the variable string. On second thought this might make sense.
- e.parameter.[key] This gives me the following error: TypeError: Cannot read property "parameter" from undefined.
I'd really appreciate some pointers or a working example, thanks.
As per the comment from Srik I tried the following:
function doGet(e) {
UserProperties.setProperty("bottleid", e.parameter.id);
return HtmlService.createTemplateFromFile('showbottledata').evaluate();
}
Which gives me the mentioned TypeError: Cannot read property "parameter" from undefined. (line 2) error.