If you frequently find yourself creating multiple Google Docs that follow a similar template and pull data from a Google Spreadsheet, this tutorial is for you. Today, I’m going to show you how to automate the process using Google Apps Script.
I liked the simplicity of this script which does a very basic data merge on Google Docs template from Google Sheets data. There is a bit of piecing together to get this one working but basically it’s uses a very simple replaceText pattern which maps the spreadsheet column number to replacement tokens {{col1}}
, {{col2}}
, etc. Read the source post to see all the code.
Source: Automating Google Docs Creation from Google Spreadsheet using Google Apps Script
Member of Google Developers Experts Program for Google Workspace (Google Apps Script) and interested in supporting Google Workspace Devs.