Note that there are some explanatory texts on larger screens.

plurals
  1. POChanging the state of apps script webapp
    text
    copied!<p>I'm making standalone web app in Google Apps Script. I have somekind of task flow in the app. First search something from spreadsheet, then do some selections what to do with the collected data and after that fill spreadsheet row with some userinputs. So I need to run between few states.</p> <p>I'm fairly sure I don't know enough about web tech so this might be very stupid question but here it goes.</p> <p>I know that the e.parameters comes from the url like this www.google.com&amp;value=helloworld , e.parameters.value returns helloworld.</p> <p>So now the problem: How do I set parameter e values in doGet(e) and call this same page or even different page/script in same script project? In otherwords how do I call self&amp;value=helloworld ?</p> <p>Is there some other way to do this? In GWT I just store everything to database and keep session in cookies. But cookies are not allowed so how to keep the state of the webapp in google apps script?</p> <p>EDIT: This is how I pass the parameters for doGet(e).</p> <pre><code>function doGet(e) { var app = UiApp.createApplication(); var newValue = 0; if(e.parameter == undefined || e.parameter.value == undefined){ newValue = 1; }else{ newValue = 1+parseInt(e.parameter.value); } var link = 'https://script.google.com/a/macros/domain.com/s/&lt;insertidhere&gt;/dev'; var anchor = app.createAnchor('Next',link+'?&amp;value='+newValue); anchor.setTarget('_self'); app.add(anchor); var label = app.createLabel(newValue); app.add(label); return app; } </code></pre> <p>The link format has changed a bit so instead of concatenate &amp;value=... you need to add ? first like this ?&amp;value1=helloworld&amp;value2=....</p> <p>Failing to use ? led me to think that there is bug and I need to use old format for the link and using that old format forbit any other than the script owner using it.</p> <p>Hopefully this helps somebody to solve similar problems.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload