Before you start you might need to watch this What Is Apps Script? A quick video introduction from Google.
When creating Apps Script solutions it isn’t long before you realise that you are writing the same code over and over. Any Apps Script can be published and so can then be used as a library that other scripts can use.
My library is called Handy Lumps and I found that these were the things I was doing all the time. It is definitely a work in progress.
Project Id: 1ykOx87hMWudgdOl3i9XND-zeV8WEieBjVwxcPYG_2iDvX5kd70KpbfIl
Useful ways to work with spreadsheets such as row_to_dict(Spreadsheet range) which when given a Spreadsheet range, looks in the spreadsheet’s header row and returns the row of data but as a javascript associative array values like this...
{“Timestamp”: 2015-09-18”, “Username”: “tom@wherever.com”, “Name”: “Tom Smith”}
...Handy, eh?
Once you have your data in an array like that above it is very easy to put your data into a Google Document template using ...
copy_and_render_to(template_id, name, values, folder_id )
This function needs a template_id which is the Id of a Google Doc in which the header names have been added with curly brackets, like this “Hello {Name}, how are you?”. It makes a copy of the document, renames it, puts the data in and saves it to the specified folder.
There are other functions for working with Google Drive or sending HTML Emails. Please help me to improve these Handy Lumps if you can. Thanks.
The excellent YouTube channel, Google Gooru, has some great quick video introductions on how to get started with Apps Script. This one shows how to do a mail merge, using a list of emails in a spreadsheet.
If you are interested in learning Apps Script at York, I run regular introductions to Apps Script, book yourself on a session here.
I would thoroughly recommend the Code Academy tutorial, an interactive site that gives you a great grounding in JavaScript.