PDFs from Spreadsheet Data and Google Docs Template - Google Sheets
Why Stack Overflow recommends it
Stack Overflow users link it as the tutorial they followed to build a Sheets-to-Docs-to-PDF script, then cite it when asking for help debugging their adapted code.
Recommended by 1 people across 1 different months, 2020 to 2023.
What it is
A 32-minute Google Apps Script tutorial showing how to generate bulk PDFs from rows of Google Sheets data by filling in a Google Docs template. It walks through the DriveApp, DocumentApp and SpreadsheetApp calls needed to copy the template, replace placeholders, and export each result to PDF.
What people said
Recommends Erick Coelho · 2023-02 · Stack Overflow · on “What's wrong with my Google Apps Script code? I get no error while debugging”
I'm no developer, but I followed this tutorial to make a PDF from data in a spreadsheet [this video] . Everything went well, until I had to change some columns on my sheet and decided to create a new project. I adapted the code, but wasn't able to make it run again. All I get is a time-out, any error on debugger. Follow the code below. Disclaimer: I hid the Google Drive files and folders IDs for privacy reasons. function createBulkPDFs() { const docFile = DriveApp.getFileById("doc-id-"); const tempFolder = DriveApp.getFolderById("folder-id"); const pdfFolder = DriveApp.getFolderById("folder-id"); const currentSheet = SpreadsheetApp.openById("sheet-id").getSheetByName("produtos"); const data = cur
Cites Kevin Cehelsky · 2020-05 · Stack Overflow · on “App Script not updating Doc to include existing data on Form edits”
I've been working on the process of auto populating a form based on a Google form submission. All of my progress to date has been what I learned on this site. Thanks for all the help! I got everything to work exactly how it needed to run, assuming that the form is filled out in its entirety. The technician fills out the google form and submits. After he/she submits, the script automatically generates a custom document with all the data. After some runtime, the technicians asked that we make the Google Form editable after submission. I did some research and found that you can make a form editable and wrote some script to auto generate a custom URL for each form. Now I'm running into an issue
Cites DanSHS Sgalia · 2020-12 · Stack Overflow · on “Save spreadsheet row data to PDF using Gdoc template using Google Apps Script”
Thanks for your input! This is the first script i've ever written and i'm following a tutorial from YouTube. [this video] I tried to define 'docfile' within createPDF() function. But it now gives me and error stating it is already defined: SyntaxError: Identifier 'docfile' has already been declared (line 35, file "CreatePDF.gs")
Cites hrTech · 2021-04 · Stack Overflow · on “bold & italic message in GmailApp”
[this video] I have program using the YouTube link that uses Google Form to google sheet then PDF using a template. But in the GMailApp script, I am unable to bold and underline. This was the message var message = `\nThank you. You have successfully completed your form. \nPlease print the attached PDF copy of the form and submit the signed hardcopy by Friday, 16th April 2021. \nNote: This is an automated system generated email. Please do not reply this email.` How to bold " Friday, 16th April 2021 " and Italic " Note: This is an automated system generated email. Please do not reply this email. ?
Cites Pannawat NaUbol · 2021-07 · Stack Overflow · on “Is there anyway to prevent creating mutiple files from script”
I'm now working on a project to create pdf files automatically from google sheet by using a script. However, I faced a problem that eveytime I want to create pdf files, the files that already created previously also being re-created. So, I want to know if there's solution to this problem. function createBulkPDFs() { const docFile = DriveApp.getFileById("xxxxxxx"); const tempFolder = DriveApp.getFolderById("xxxxxx"); const pdfFolder = DriveApp.getFolderById("xxxxxxx"); const currentSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("xxxxxxxx"); const data = currentSheet.getRange(2, 2,currentSheet.getLastRow()-1,6).getValues(); data.forEach(row => { createReport(row[0],row[1],row[2],