Reader small image

You're reading from  Google Apps Script for Beginners

Product typeBook
Published inFeb 2014
Reading LevelIntermediate
Publisher
ISBN-139781783552177
Edition1st Edition
Languages
Right arrow
Author (1)
Serge Gabet
Serge Gabet
author image
Serge Gabet

Serge Gabet has been a professional audio equipment manufacturer for 20 years and is now working for an artistic upper school in Brussels, Belgium as a teacher and Technical Manager. He is also in charge of the Google Apps administration of this school. He develops custom applications using Google Apps Script mainly for his school, though he also works in other areas. He has been designated a Top Contributor by Google since June 2011. He was active on the Google Group Help forum till 2012, then on the Stack Overflow forum (the Google Help Group forum was closed in June 2012), and became a first ranker and an all-time contributor on the Stack Overflow forum a few months back.
Read more about Serge Gabet

Right arrow

Generating a Google document from spreadsheet data using a script


I mentioned earlier that we could have used a spreadsheet in the previous Gmail example to log the data we retrieved from the e-mail messages, but that the document approach was more pleasant in terms of "look". So I suggest that we try to build a Google document from data stored in a spreadsheet.

The data can be a list of addresses or recipes. It doesn't really matter what data we use as the methods we use will be the same, but we'll use the list of recipes because they have pictures in them and had might as well give you some ideas for your next weekend lunch.

The following screenshot shows how our current data sheet looks—it's not very elegant:

We already know how to get data from a spreadsheet (see Chapter 1, Enhancing Spreadsheets) and that using getValues() will return an array of arrays with all the cells' data in a raw format.

Each row will be an array of values corresponding to each cell; these arrays will in turn be...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Google Apps Script for Beginners
Published in: Feb 2014Publisher: ISBN-13: 9781783552177

Author (1)

author image
Serge Gabet

Serge Gabet has been a professional audio equipment manufacturer for 20 years and is now working for an artistic upper school in Brussels, Belgium as a teacher and Technical Manager. He is also in charge of the Google Apps administration of this school. He develops custom applications using Google Apps Script mainly for his school, though he also works in other areas. He has been designated a Top Contributor by Google since June 2011. He was active on the Google Group Help forum till 2012, then on the Stack Overflow forum (the Google Help Group forum was closed in June 2012), and became a first ranker and an all-time contributor on the Stack Overflow forum a few months back.
Read more about Serge Gabet