This channel focuses on producing high-quality technology trainings for working professionals. Using this channel, you can learn more about the Google Drive tools, including Google Docs, Google Forms, Google Sheets. You can also find helpful tutorials on topics in web deveopment.
Nice, Excellent but I have a problem how to fix this problem : "TypeError: googleDocTemplate.makeCopy is not a function" ini my Script link this : "const copy = googleDocTemplate.makeCopy(`${row[1]}, ${row[0]} Employee Details` , destinationFolder)" please, Thank you 🙏
I must be doing something wrong, it will continue to make documents for all of my blank fields and filling up my google drive with a bunch of empty docs .
Hi, why this not work for me. It was an error: TypeError: Cannot read properties of undefined (reading 'values'). I copied the code but not working. Can you help me?
Hi Jeff! Thank you for this. I'm looking to import "in-line" text into a Google Doc from a Google Sheet? I think this is really a close way to do it. I'm trying to make a report like this: You webpage got X,XXX visits this month and we posted X,XXX pieces of content. This would pull from a Google Sheet with all that information, but would also be able to tell which month it's in so it would update monthly. Could I use this script to do that or would it need to be different? I don't need to creat new documents, just update the one document from multiple already created Spreadsheets. Thanks for the resource!
Hi thank you for this tutorial. I do according to your instruction. However for the columb that includes a link, it doesnt work. It only works with text. How can I fixx it
I am late to this party but this was a very cool script to learn hot to use. Thank you so much. Could you share with me the what I need to add to this script to get it to then auto send an email with the link or document attached. Is that possible to do. Your tutorial was very good thank you again.
It's a little bit more complicated, you'd need to use this class to do it: developers.google.com/apps-script/reference/spreadsheet/spreadsheet#createTextFinder(String)
Thank you; however, I can't seem to get the info to show up in my document. ALL of the fields {{DATA}} have not changed. I copied exactly what you have, but the documents are exactly as I created them (without the Google Sheet data).
Hi, thanks for sharing. the video is well done and understandable, I tried to replicate it but I have this error function createnewgoogleDocs ( TypeError: SpreadsheetApp.getActiveSheet(...).getSheetByName is not a function) I'm using google worspace, I don't think it makes any difference, but I'll let you know. thanks
Great video. I have a question though. Your Google app script primarily works for one column and multiple rows in google doc. Can you help us with Google app script where it generates multiple columns and rows table on Google doc using the data that is available on a single row of Google sheet?
Hey! Non developer here trying to better automate client status reports. With each new form submission will I be able to have the info added to the same document every time or will it create a new document?
Great video. I am beginner to Google app scripts and I did exactly like the way you explained in the video but I am getting an error message when I clicked on on "Auto fill Docs": Type error: Cannot read properties of null (reading 'get datarange'). Can you help please?
It would help if you linked your completed code in the description for people to use, this is a great content/instructional video, but I do think if people saw the completed code it would lend to your channel getting more attention. Either way, thanks for the instructions!
i love you, thank you so much. Do you know how to get the header section? because the body.replaceText only works on body elements, and I have to replace some text in the header of my documents
thank you! you really put in the effort to explain everything so that beginners like me can understand the reasoning behind each line and therefore customize the script later on.
My dates in the google doc are showing one day less than the actual date in the google sheet. Also is there a way to get the date format as MMM-dd-yyyy.Thank you for the tutorial it was really helpful. I am just stuck with the dates part of it. Please help. Thank you
Thank you for the great tutorial. I was wondering if it is possible to have the filled Docs merge into a single Doc, rather a separate doc for each employee. Thanks
Hello, the google document is successfully being generated in the response/populated folder but somehow when i opened the populated file, the values that are not being updated/changes from the google sheet to the google document. Here is the script im using: function autoFillNoticeOfPastDueAssessmentLetter(e){ var timestamp = e.values[0]; var hoaName = e.values[1]; var dateOfLetter = e.values[2]; var homeOwnerName = e.values[3]; var unitNumberStreet = e.values[4]; var city = e.values[5]; var state = e.values[6]; var zipCode = e.values[7]; var outstandingBalanceAmount = e.values[8]; var unitAccountNumber = e.values[9]; var mcmOfficeBranchNumber = e.values[10]; var templateFile = DriveApp.getFileById("1i9_EVGoS_SKfhZv1T4grw5Y2kHg_hgDo"); var templateResponseFolder = DriveApp.getFolderById("1mfkEknW-kmkzjDj5qQ9K_PM7gAj7UY1I"); var copy = templateFile.makeCopy(dateOfLetter + ', ' + hoaName + ', ' + homeOwnerName + ', ' + unitNumberStreet , templateResponseFolder); var doc = DocumentApp.openById(copy.getId()); var body = doc.getBody(); body.replaceText( body.replaceText("{{HOAName}}",hoaName); body.replaceText("{{Date}}",dateOfLetter); body.replaceText("{{HomeownerName}}",homeOwnerName); body.replaceText("{{UnitNumberStreet}}",unitNumberStreet); body.replaceText("{{City}}",city); body.replaceText("{{State}}",state); body.replaceText("{{ZipCode}}",zipCode); body.replaceText("{{OutstandingBalanceAmount}}",outstandingBalanceAmount); body.replaceText("{{UnitOwnerAccountNumber}}",unitAccountNumber); body.replaceText("{{MCMBranchPhoneNumber}}",mcmOfficeBranchNumber); doc.saveAndClose(); } Let me know what im doing wrong in this case. Thank you so much!
Hi Jeff, very well done ... and it helped me a lot. But i have another issue ... ( e.g. an Invoice with header informations and then a table with the invoice items ) In my template the items are in a table ... and this is where the problem starts. How can i fill in a loop item for item in the docs template ( items in a table ) ... All over the net i found no solution ... 😢
Hi Jeff, very well done ... and it helped me a lot. But i have another issue ... ( e.g. an Invoice with header informations and then a table with the invoice items ) In my template the items are in a table ... and this is where the problem starts. How can i fill in a loop item for item in the docs template ( items in a table ) ... All over the net i found no solution ... 😢
Does this method still work? Tried using "e" as a parameter and seems like the script doesn't know that I'm referring to the spreadsheet populated by the form.
Thank you very much for your hard work, even when I don't know programming, I love this is easy to understand. I did it for some documents a friend needed and it worked!! We will just adjust some stuff, but the initial run was a total SUCCESS!! XD
Thanks Jeff. I want to use a Google Form to add user content to a series of educational documents and I have been struggling mightily to automate my solution. After Googling for a solution, I turned to ChatGPT and after approx 40 diff Apps Script "solutions", I gave up on the AI & searched RU-vid and found your 3 yr old video. Problem solved.
This is somethig I need for my classroom to generate a home detention doc that generates a form for parents re student last first period date/time, and behavior from a pull down list (will this work if the cell is a list of behaviors?). Also how could one create a script that will generate the same information twice on one page so there can be an English and Spanish on one doc one page or two page to be printed 2-sided.
Hi there. Love this video. As others have said, I am hoping to save some time in creating documents in my role as a Parent-Teacher Group chairperson. Anyway, I am getting an error on the final step "ReferenceError: setValue is not defined". This is my 1st go with coding, but I have checked the code several times. A quick search did bring up some results about their being a problem with the setValue function in newer versions of Apps Script. Is this the case? If so, any help on how to fix it?
This is really useful! Is there a way to automatically link the new pages you create back to the parent spreadsheet, so that certain columns can be filled in when the sheet for a particular row is modified?
This doesn't work for me. the (e) and e.values does not return the values from my sheet into the document. It just leaves it as the {{firstName}} tags.
function autoFill(e) { var timestamp = e.values[0]; var emailAddress = e.values[1]; var lastName = e.values[2]; var firstName = e.values[3]; var period = e.values[4]; var studentID = e.values[5]; var songTitle = e.values[6]; var musicArtist = e.values[7]; var youtubeLink = e.values[8]; var templateFile = DriveApp.getFileById("deleted for post"); var templateResponseFolder = DriveApp.getFolderById("deleted for post"); var copy = templateFile.makeCopy(lastName + ', ' + firstName, templateResponseFolder); var doc = DocumentApp.openById(copy.getId()); var body = doc.getBody(); body.replaceText('{{lastName}}', lastName); body.replaceText('{{firstName}}', firstName); body.replaceText('{{timestamp}}', timestamp); body.replaceText('{{studentID}}', studentID); body.replaceText('{{emailAddress}}', emailAddress); body.replaceText('{{songTitle}}', songTitle); body.replaceText('{{musicArtist}}', musicArtist); body.replaceText('{{youtubeLink}}', youtubeLink); body.replaceText('{{period}}', period); doc.saveAndClose(); } The tags are typed exactly from the doc template. What's going wrong?
Check out this article that covers the most common reasons for this error: jeffreyeverhart.com/2016/08/06/fix-typeerror-cannot-read-property-values-undefined/
I just started a role at a new company and docs and sheets are a major part of the workflow. This gives me a great quick way to automate things without standing up a full Python or Node.js application to do it.