Create documents from a Google Sheet based on a template using Google Apps Script.
Copy the data in the spreadsheet_example file as a sample.
Get the Id of the Sheet and insert it into SHEET_ID variable in Settings.gs file
This is the file that will be used as a template for generating new documents.
Copy the data in the template.docx file as a sample.
Get the Id of the Document and insert it into TEMPLATE_ID variable in Settings.gs file
This is where the the newly generated files will be saved.
Get the Id of the Folder and insert it into TARGET_FOLDER_ID variable in Settings.gs file
-On the left-hand side, click on Triggers
-Click on Add Trigger
-Choose your preferred trigger method
-Go to Code.gs file.
-Click on the Run button.
Modify the placeholders name in the KeysDictionary.gs file to setup your own template.
Names of the placeholders should match the ones in the Template Document.
Format (0:"TIMESTAMP_PLACEHOLDER") => (Column Number:"NAME_OF_PLACEHOLDER_IN_TEMPLATE"). First column is 0.