Views
Google Persistant Variables
From Shadowfax
It didn't take me long to realise that JavaScript global variables did not work very well with Google scripts. To an extent this makes sense because each time the script is run it effectively reloads, overwriting any globals. However it does cause me a significant issue when trying to use Event Handlers as - other than using object ids - I was struggling to pass information around the script. Fortunately Google have thought of this and helpfully provided the Properties Service to allow variables to persist.
ScriptProperties.setProperty('parent','root'); var parent = ScriptProperties.getProperty('parent');
Leave your comment