google-apps-scriptweb-applicationsgoogle-sites

How to pass parameters to Google Apps Script Gadget embedded in a Sites Page?


I have a Google Apps Script gadget that is embedded in a Google Sites page. I would like to pass the gadget a page parameter, such that when the page is opened with URL like:

https://sites.google.com/a/mydomain/mysite/mypage?myparameter=1

I can access the value of the page parameter in the Apps Script gadget code like so:

function doGet(e) {
  var app = UiApp.createApplication();
  app.add(app.loadComponent("MyComponent"));
  var myparam = e.parameter.myparameter;    
  return app;    
}

Currently, the value of e.parameter.myparameter is coming back as null. Is there a way to setup my Apps Script to support this? Any approaches are welcome.


Solution

  • Maybe the link bellow will help you - I have not tried it myself yet...but I will try it out in the next days. http://code.google.com/p/google-apps-script-issues/issues/detail?id=535