Getting back to your roots!
The company I have been working for, for the better part of a decade now was originally created as a Google Apps Service. The original income for the company would be built around helping companies adopt Google Apps and Office Suite, performing migrations out of OnPrem Data Centre mail services and into the Cloud.
This was a lot of fun, but as the Cloud has evolved from all those years ago and new services have come onboard, there has not been much time to play.
Although, despite the sentimental walk down memory lane, I have to say I do not miss the horrible GWMME (or GAMME as it was known back in the day!) with gapps to migrate data from clients on-prem up to their new Google Suite.
Dusting off the old code bases
Below is a small random value generator I made for fun, it uses backend data from the Google Sheet API to generate a small app which is embedded in to this web page.
What should I cook?
To change values click here then refresh for the update!
You can find the code for this exercise here.
The science!
This is nothing complex, the values are stored in the same spreadsheet and we expose a single sheet to the world. By Abusing the Google app script magic functions, we can create a web app from a Google Office Element and have it display on another Free Service, drastically increasing our ability to make content! Even with no web experience!
The Google API Service is vast and plugs in to numerous services, this blog itself can be posted to with the right credentials and data in the payload. A lot of the GSuite's power comes from App Script and can help make automated task an easier reality, adding additional function on top of the native office functionality (Function in Google Sheets for example).
As well as the above, App Script has some magic functions to enable a user to perform even more automation, it boasts an impressive set of built in triggers that can easily adopted.
To use a simple trigger, simply create a function that uses one of these reserved function names:
- onOpen(e) runs when a user opens a spreadsheet, document, presentation, or form that the user has permission to edit.
- onInstall(e) runs when a user installs an Editor add-on from within Google Docs, Sheets, Slides, or Forms.
- onEdit(e) runs when a user changes a value in a spreadsheet.
- onSelectionChange(e) runs when a user changes the selection in a spreadsheet.
- doGet(e) runs when a user visits a web app or a program sends an HTTP GET request to a web app.
- doPost(e) runs when a program sends an HTTP POST request to a web app.
Extending Permissions
As the Google App Script service runs on GCP, it is possible for a user to associate the runtime environment with their GCP account to give more fine gained permissions and to gel their creation back in to any Google Eco-System that has been built/provided on the Google Cloud Platform. This can be neatly tied in to your Google OAuth settings
And that's how it's done!
Have a play with the above and see what you should cook! Some of the Logic created here is just a fun PoC to be reused in other projects, in another post I will go into more detail on the codebase and setup so you, yourself can have your own random word generator and abuse the Google Apps Service!