Creating mailing labels in Google Docs (create doc from template with an array of data)

Hi all,

I am trying to create mailing labels (multiple labels per page) in Google Docs using the “create a document from a template” module. My data is coming from Google Sheets.

My first attempt at this, I put my fields in only one label on the template. That resulted (as you might expect) in one document per row of data.

So I thought maybe I could aggregate the data into an array, but that resulted in only one document with the first row of data only.

Am I missing something obvious in managing the array, or am I using the wrong module for this purpose? If the Google Docs add-ons for mail merge weren’t so annoying, I would just use that, but I have had similar problems with other scenarios where I have wanted to use an array of data in a create-a-document-from-a-template module, so I am eager for assistance. Thanks!

scenario.blueprint.json (16.8 KB)

Hello @Rebecca_Katz1,

I’m assuming you do not want to same data on all labels, rather they need to be unique?

How many labels are on one Google doc?

For each label’s placeholder, you’ll need to create unique placeholder text. For example:
If you have 3 labels across and 5 down to get 15 labels on a page, you’ll need 15 pairs of placeholders.

{{name1}}
{{address1}}

{{name2}}
{{address2}}

{{name15}}
{{address15}}

After Google Sheets, place an Array Aggregator so that you can get all the Google Sheets output into an array. In the Google Docs module, each placeholder will have to use get() to get each value from the array according to its placeholder number. i.e. name1 should have something like get(array.1.name) or for address15, get(array.15.address).

Hope that helps!