Auto Fill Google Doc from Google Form Using Google Apps Script

  Рет қаралды 192,129

Jeff Everhart

Jeff Everhart

Күн бұрын

Пікірлер: 479
@HighGravityHipHop
@HighGravityHipHop 2 жыл бұрын
Hey Jeff - I am doing a Fill In the Rhyme Workshop for a DEI Class I am launching. This was perfect for saving my students a step by taking their form and completing the document I will give them to rehearse from. You just helped me write my first little script - I am learning solidity as a hobby, so this was neat to incorporate into my education project. Worked like a charm. I got one error -misplaced comma that I quickly noticed and worked perfectly after that. Great job man - great pace, great detail, super job brother!
@matthewcashatt1453
@matthewcashatt1453 11 ай бұрын
I'm getting undefined errors for all variables starting with e. What am I doing wrong?
@ruchitachani
@ruchitachani 9 ай бұрын
I’m getting the same error. Were you able to find a fix? @matthewcashatt1453
@hoang16191
@hoang16191 3 ай бұрын
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?
@chuck4546
@chuck4546 2 жыл бұрын
Jeff, I'm just getting back into coding and could not stand the online courses. I did your simple example, and it is indirectly related to one of my projects, and I am hooked. The code is simple but it gives me a start. Good job and thanks.
@dabeldasac921
@dabeldasac921 Жыл бұрын
The best, easiest, simplest explanation i'v ever seen! Thank you so much1
@katdancer8752
@katdancer8752 3 жыл бұрын
Finally. I have been looking for this solution. Thanks for the explanation Jeff.
@jeffeverhart
@jeffeverhart 3 жыл бұрын
you are welcome. Thanks for watching!
@fikrikasmani4912
@fikrikasmani4912 Жыл бұрын
Tried used it but get error cannot read properties of undefined (reading 'values'...
@maryteel4578
@maryteel4578 2 жыл бұрын
This was so helpful for me and my colleagues as we streamline some form submissions at our school. As a chemistry teacher- I know zero coding terms so please bear with me! We were wondering if there is a way to add code around line 10 for the file name to add a 1,2,3 ect if the same person submits the form. Ex. John Doe 1, John Doe 2. We have students who should complete the form once, but sometimes redo if they need to. (I know we can look at time stamps- we are just trying to streamline it). We also wondered if there is a way for the new document created's link to be inserted in the spreadsheet's row for that document. This tutorial was amazingly helpful! Thank you so much for it as well as the vast amount of information on your site!
@danielalejandrocordovadela657
@danielalejandrocordovadela657 2 жыл бұрын
I really loved this tutorial. Very well detailed, and the code part is also very well explained. I have a question. If I want to put all the answers in one Google like a list of names, nationalities, age, etc; how would it be?
@analuciaalegre735
@analuciaalegre735 2 жыл бұрын
Hello Jeff!! Thanks for this extremely helpful video. I hope I can get your help on these two questions: 1) How would I go about also creating an auto-saved PDF version of that google doc (a pdf that will download when i click the link in the column) perhaps in the column adjacent to this one: is this possible (do you have a link on your website for this as a tutorial?) 2) How do I get the script to STOP or NOT run if the actual spreadsheet row is empty? Sometimes I have a few extra empty rows in my GoogleSheet, and this script will keep running and essentially create empty documents. I assume this is something I can add as an "if" statement in the rows.forEach(function(row,index){}, and ive been trying to experiment but not able to figure it out. In otherwords, something for example, "if the first column of my spreadsheet is empty, DONT create a document, (e.g., return))". I tried adding in "if (row[1 === 0]) return;", which i understand to mean, if Column B in my spreadsheet is empty, skip this row, but that doesnt seem to work). ****EDITING MY QUESTION as i think i found my answer to my second question. I added if (row[1] == "") return; and that seemed to work :) Thanks in advance for your help for question 1 , and happy new year!!
@chrisnorris8128
@chrisnorris8128 2 жыл бұрын
This is so helpful! What might I do if I have a question on my form that allows for checkbox/multiple answers? How would we deal these out to specific cells?
@mazettipedro
@mazettipedro 5 ай бұрын
Man, I can't believe this worked, thank you so much.
@jeffeverhart
@jeffeverhart 4 ай бұрын
Awesome, thanks for watching!
@e1vis14
@e1vis14 3 жыл бұрын
Jeff, this was really clear and easy to follow. If you are still answering questions, I'd love some advice. I want to create a form that appends to a Google Doc each time it's submitted, not create a new doc with each submission. Basically, to take notes (date, subject, note text). Each note would append to the file (gives me a searchable file to find command lines, etc). Can that be done? I suspect most of what you described here would be used.
@jeffeverhart
@jeffeverhart 3 жыл бұрын
I do that here using a table, so that might work, but you could always set it up to append a paragraph or something else: jeffreyeverhart.com/2020/05/18/open-letter-maker-with-google-forms-docs-and-apps-script/
@AlberichRheinmann
@AlberichRheinmann 8 ай бұрын
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 ... 😢
@meryemormanc2705
@meryemormanc2705 4 жыл бұрын
Hi, You are super. How can it be done without creating a form? Print the data from the Google Sheet list to the word document. How will the script code be written?
@jeffeverhart
@jeffeverhart 4 жыл бұрын
Hi, thanks for watching. I've had so many people ask for an automation that runs from a sheet instead of a form, so I made a video and blog post that describes exactly that: kzbin.info/www/bejne/n32kfYqOZcSCj9U Thanks for watching!
@pascualasylleros2294
@pascualasylleros2294 2 жыл бұрын
Hi, excelent video, it was very easy to follow. I have a question tho, do you know how to autofill a doc from multiple google forms? Thanks
@markzalavari1780
@markzalavari1780 Жыл бұрын
Hi! Jeff! I think you solved my long long journey on finding sort of this solution! Thank you! I would like to populate data rows of a spreadsheet to more documents. So the scenario is: to make a folder by the name of the selected client and generate documents by his/her data by templates. I may trigger the selected clients document generation by filling a form or tick a mark in a cell. Do you think this method is available to do this?
@_dimasadi
@_dimasadi 2 жыл бұрын
Can we also auto fill google doc with images that is submitted from the Google Form?
@christiansotelo2543
@christiansotelo2543 4 ай бұрын
Just wanna know if this applicable if i have an existingntemplate fill it in docs?
@richardmak9533
@richardmak9533 2 ай бұрын
I dont have the option to select event source "from spreadsheet", what do i do
@zertoix1806
@zertoix1806 4 жыл бұрын
Can you make video about how a section can increase in numbers? Example Test 0 increases to 1 each time the form is used.
@mayakannan8083
@mayakannan8083 Жыл бұрын
How to get linear scale data from form to google docs.please help me out
@jenniferrobertson8796
@jenniferrobertson8796 Жыл бұрын
How do you get it to update the same document over and over and add new rows of data to the same google doc? For instance, if I created a journal and I wanted my Google Forms entries to populate into my doc continuously?
@_sherps2831
@_sherps2831 3 жыл бұрын
I am curious about implementing a checkbox grid style of answer. For example, if I wanted to choose a specific location, then certain team members to assign to a project from that location, then it creates columns for each location. Is it possible to do an "if not blank" style of function to auto-populate the appropriate team members into the template doc? I have put in a e.namedVariable but then columns must be the same name and it doesn't tell the name of the location that way.
@alanacruz6482
@alanacruz6482 Жыл бұрын
Hi jeff, for some reason, mine did not work it notifies me that there was a TypeError: Cannot read properties of undefines (reading 'Values') and i have no idea how to fix it but great tutorial, very easy to follow
@2345erewqesdf
@2345erewqesdf 2 жыл бұрын
How do you send it as pdf attachment to the provided email address
@santosrodrigueziiikimbarke2138
@santosrodrigueziiikimbarke2138 3 жыл бұрын
Thank you Jeff. This video is awesome and has helped me with my small project. I have a quick question. If I wanted to send the doc that was created to a person through email. How would I go about that. Any help would be greatly appreciated. Thank you
@miguelbautista5031
@miguelbautista5031 3 жыл бұрын
Thank you Jeff for this tutorial. I have a question. Is it possible to get the responses to go into a table within the same document? I am looking to input all of the responds on 1 table within 1 document. The table will have 15 rolls.
@jeffeverhart
@jeffeverhart 3 жыл бұрын
Thanks for watching. You can check out this blog post for an example that writes stuff to a table: jeffreyeverhart.com/2020/05/18/open-letter-maker-with-google-forms-docs-and-apps-script/
@pjsmith6425
@pjsmith6425 4 жыл бұрын
Is it possible to conditionally format paragraphs based on responses? An example would be the selection field will populate one paragraph if a certain selection and another with a different selection.
@jeffeverhart
@jeffeverhart 4 жыл бұрын
Short answer is absolutely you can do that. You would want to write an if/else statement that checks the value you want to look at, then run different replace function based on that check: www.w3schools.com/js/js_if_else.asp
@ssomprakash2076
@ssomprakash2076 4 жыл бұрын
Hi jeff! Your video was very helpful to me. Thanks alot🔥❤️ I don't know anything about coding but after watching your video I made a form that will help me in my work. Just need one more help- How to attach uploaded file from google form to doc? Again thanks a lot u r a savior!🔥
@jeffeverhart
@jeffeverhart 4 жыл бұрын
Thanks for all the kind words. I've got a post/video in the works that describes just that thing, but for now someone figured out how to do it and posted the code in the comments on the linked blog post.
@muhammadbayat7793
@muhammadbayat7793 Жыл бұрын
Hey Jeff Excellent and very easy to follow. Was able to modify for my needs. Is there a way of running the script automatically every time a new row is added. Instead of having to click the create new doc button? Thank you Muhammad
@AbhishekKumar-cs5ll
@AbhishekKumar-cs5ll 3 жыл бұрын
can we have a document section too added to the last column which can automatically be filled whenever auto-generated document is created?
@garethpearson476
@garethpearson476 3 жыл бұрын
Thank you so much for this video! I followed all of your steps to the letter. Unfortunately, when I recreated this same process, my different Google Doc copies don't have the replacement Google Form response inputs. Instead, they still say {{FirstName}}, {{LastName}}, etc. Is there any advice you could offer to help remediate this problem, please? Thank you!
@brandongoulet4801
@brandongoulet4801 2 жыл бұрын
I had the same problem. I reverted back to the old editor version and it magically worked. I have no idea why it wouldn't work in the new editor.
@ReyMartinez1980
@ReyMartinez1980 3 жыл бұрын
is there a way to put a date rage in one document. It would be awesome if all rows could be pulled into one document. For example let's say you have 10 employees and wanted to generate a report showing all 10 on 1 document not 10 separate docs.
@abhishekborade5303
@abhishekborade5303 3 жыл бұрын
Thanks, Jeff, is there any way possible to convert the google doc that we got into a PDF?
@adriansolberg6993
@adriansolberg6993 3 жыл бұрын
I would have wanted that too
@jeffeverhart
@jeffeverhart 3 жыл бұрын
You can see an example of that here: jeffreyeverhart.com/2015/01/30/tech-tip-google-forms-confirmation-email-with-attachments/
@arlanticoangellou945
@arlanticoangellou945 2 жыл бұрын
Are you using Producer edition?? What do y'all recomnd if I want to make s but not record my voice or tutorial?
@janoskernya5351
@janoskernya5351 3 жыл бұрын
Hi Jeff, This video is amazing! Helped me a lot! Could you please help me to expand the code to generate the data into PDF as well? Thank you very much!
@jeffeverhart
@jeffeverhart 3 жыл бұрын
Sorry for the late reply, but you can see an example of that here: jeffreyeverhart.com/2015/01/30/tech-tip-google-forms-confirmation-email-with-attachments/
@Zeoytaccount
@Zeoytaccount 2 жыл бұрын
Did anyone figure this out? I'm completely stumped lol. It seems like there should be a simple command to download the .pdf after we define the variable but I can't find one.
@XxCrazyMix123
@XxCrazyMix123 2 жыл бұрын
Somethings changed. I've done this over 10 times over with no typos but one thing keeps not working. Everything works except replacing words
@Tito-ve6sz
@Tito-ve6sz 3 ай бұрын
kalau ingin langsung menyimpan dalam format Pdf bagaimana caranya?
@guilhermepreuss7429
@guilhermepreuss7429 4 жыл бұрын
Thank you very much! So very useful for my needs. I wonder if you can help me improve it a bit, though: I also need another var that, for instance, is a PROCV working on the 5th column, based on the key at column 4. I realized I can't make use of "var example = e.values(4);" to retrieve it. Would you be so kind to point me towards the solution?
@jeffeverhart
@jeffeverhart 4 жыл бұрын
Sorry for the late reply, but if you are using calculations in the sheet, it might be easier to do something like this: jeffreyeverhart.com/2020/09/29/auto-fill-a-google-doc-template-from-google-sheet-data/
@ghostling78
@ghostling78 4 жыл бұрын
Just got an error -> TypeError: Cannot read property '0' of undefined
@lukeandsallylowandmarion2584
@lukeandsallylowandmarion2584 3 жыл бұрын
The reason is that you have attached the code on the form not the form itself
@keithhipkin2376
@keithhipkin2376 3 жыл бұрын
@@lukeandsallylowandmarion2584 Hi, Could you expand on this comment?
@pkmsolutions7676
@pkmsolutions7676 3 жыл бұрын
Hi Jeff, this Code was amazing i just have a other question. Can i add a Code after saving the Tamplate to send this Tamplate iva Email at the costumer directly?? Thenk u in advance.
@briana.montgomery1134
@briana.montgomery1134 Жыл бұрын
great video but for some im having issues trying to do the exact same thing
@nelsonpacheco2055
@nelsonpacheco2055 3 жыл бұрын
thanks, this is a great example
@jeffeverhart
@jeffeverhart 3 жыл бұрын
You are welcome!
@aggiechase37
@aggiechase37 3 жыл бұрын
Hi Jeff, Thank you so much for the video! We are a counseling organization doing counseling for kids in foster care, and I rigged this so that our counselors can do notes from it. One problem. I think I need to add a wait function. About 4 percent of the time I get this: "Exception: Service Documents failed while accessing document" emailed to me. Google support was no help, of course, so what would be the proper method to add a wait function? I'm not a coder of any sort, but I'm thinking this should appear after "var body = doc.getBody();" in the code. Correct?
@aggiechase37
@aggiechase37 3 жыл бұрын
Or perhaps a promise function? Like promise the document load before it starts getting copied and written to? I'm not sure.
@greyalcasarin6526
@greyalcasarin6526 4 жыл бұрын
Hi Jeff. Thank you for this very helpful info. I just have a question. Do we always have to put tables in order for the script to work? I tried doing it but I did not add tables on the docs, I just added the 2 "{{}}" unfortunately it did not work.
@jeffeverhart
@jeffeverhart 4 жыл бұрын
There needs to be some matching text I would think
@domenico.ballarini
@domenico.ballarini Жыл бұрын
Very useful! Thank you very much!
@StoneAndLightGuidance
@StoneAndLightGuidance 2 ай бұрын
Thank you, kindly!!
@sanjayd5604
@sanjayd5604 2 жыл бұрын
How to send gmail for process?
@changgao5312
@changgao5312 4 жыл бұрын
Is there a way to do it backwards? Use a scrip to auto fill the google form
@amirulhelmi8579
@amirulhelmi8579 3 жыл бұрын
hey jeff, I tried to follow your tutorial step by step but it didn't. It said all my variables are undefined. Could you help me on this.
@gash4192
@gash4192 2 жыл бұрын
Loved this!
@MrTdoug57
@MrTdoug57 4 жыл бұрын
Hey Jeff, great code. I was wondering if you knew how I could auto populate names and answers/checks from a google sheet onto a Google form?
@MrTdoug57
@MrTdoug57 4 жыл бұрын
Now that I think of it, it really sounds like a bot for google forms...
@jeffeverhart
@jeffeverhart 4 жыл бұрын
I think this would be possible since there is a FormApp class: developers.google.com/apps-script/reference/forms
@roxiefindsen3989
@roxiefindsen3989 Жыл бұрын
For some reason this coding stopped working for my form. I'm now getting a: TypeError: cannot read property 'values' of undefined
@jeffeverhart
@jeffeverhart Жыл бұрын
Check this post jeffreyeverhart.com/2016/08/06/fix-typeerror-cannot-read-property-values-undefined/
@ashwinvidiyala
@ashwinvidiyala Жыл бұрын
Holy shit this is fucking phenomenal. Thanks dude!
@jetyeee
@jetyeee 3 жыл бұрын
Hi! would like to ask if in the end you submit the form again it should create another google doc , am I right?
@jeffeverhart
@jeffeverhart 3 жыл бұрын
In this example, yes that is what it will do
@jenniferwright3102
@jenniferwright3102 3 жыл бұрын
I''m not seeing the From Spreadsheet option for trigger only the From Form option. Was this updated by chance?
@jeffeverhart
@jeffeverhart 3 жыл бұрын
Make sure your script is created from the spreadsheet and not the form
@davidpetchrothai3607
@davidpetchrothai3607 2 жыл бұрын
I cannot achieve my own form to doc, even I duplicate these file the script keep saying TypeError: Cannot read property 'values' of undefinded. How can i fix this?
@jgk1312
@jgk1312 2 жыл бұрын
Not sure if this was your issue but I got help here: www.reddit.com/r/GoogleAppsScript/comments/u3fbhs/help_google_form_submission_to_google_doc_via/?sort=new
@paulandrewsantos4487
@paulandrewsantos4487 4 жыл бұрын
How about saving it in .pdf format rather than google docs? thanks!
@jeffeverhart
@jeffeverhart 4 жыл бұрын
You could do that as well by using doc.getAs('application/pdf') developers.google.com/apps-script/reference/document/document#getAs(String)
@ARIFMAULANADANANJAYA
@ARIFMAULANADANANJAYA Жыл бұрын
nice video, question TypeError: Cannot read properties of undefined (reading 'values') how to fix that?
@drbavithrandeda6569
@drbavithrandeda6569 2 ай бұрын
even I got the same when I tried today , got any fix for it ?
@Uh-e8r
@Uh-e8r 7 ай бұрын
how can you declare (e) ??? it is not working when i try this script
@albertsimpkins2544
@albertsimpkins2544 2 жыл бұрын
hi, thank you very much for this tutorial. I'm absolutely new to coding but this is exactly the usecase i need for work. However, when i copy your code and insert my file and folder ID's i always get this error notfication: function autoFillForm(e) { var name = e.values[0]; var nachname = e.values[1]; var standort = e.values[2]; TypeError: Cannot read property 'values' of undefined autoFillForm @ Code.gs:2 I haven't quiet understood the meaning of (e) in the function name Can you help?
@XxXVidmanXxX
@XxXVidmanXxX 2 жыл бұрын
Same issue here
@danhawkins2705
@danhawkins2705 2 жыл бұрын
@@XxXVidmanXxX Exactly the same error here.
@mayonvolcano4404
@mayonvolcano4404 2 жыл бұрын
I got an error saying that the e and the other values from e is undefined
@furiousflower
@furiousflower 3 жыл бұрын
To be honest: this was way too complicated for me and I'm still stuck with the problem I am trying to solve 😂 But I am liking and comment for the algo, because I really like your energy in the tutorial. Thanks!
@l2OI3
@l2OI3 4 жыл бұрын
This was exactly what I was looking for to populate a document with client info, thank you!
@jeffeverhart
@jeffeverhart 4 жыл бұрын
Awesome! Glad it worked for you. Thanks for watching!
@weazelnewsdigitrp1224
@weazelnewsdigitrp1224 4 жыл бұрын
@@jeffeverhart dude you are well spoken, at the right pacing and nailed this guide for a not-casual-actually-stupid-person :) way to go!
@ZayedDabaja
@ZayedDabaja 3 жыл бұрын
Yes thank you
@ZayedDabaja
@ZayedDabaja 3 жыл бұрын
@@jeffeverhart please make more complicated stuff for appscript
@jeffeverhart
@jeffeverhart 3 жыл бұрын
Thanks, any thoughts on what topics you'd like to see covered?
@palmermiddle5804
@palmermiddle5804 4 жыл бұрын
Thank you, Thank you, Thank you. This is perfect for quickly creating, organizing, and sharing lesson plans.
@jeffeverhart
@jeffeverhart 4 жыл бұрын
Glad it was helpful! Thanks for watching
@idoaikerja1187
@idoaikerja1187 Жыл бұрын
hi Jeff, magnificent!! after trying, i managed to make it work.. anyway if I make another column in the sheets for example D2, containing "=left(a2,3)".... and i declare "var nick = e.values[4];".... and "body.replacetext('{{nick}}', nick);"..... the {{nick}} in the docs stay untouched, while the {{firstname}}, etc can be changed.. do you know what's wrong?
@rubiks1kid
@rubiks1kid 2 жыл бұрын
Hey Jeff, First of all, this video was so amazing! Thank you so much for making this. I do have a couple of questions that hopefully you can address. 1. If I was to enable the form to upload a photo, How would I go about ensuring that the google doc pasted in the actual photo instead of just a link to where the file is located on my google drive? Is this possible to do? How would I go about doing it? 2. I was trying to make it to where the populated file would then email itself to whoever filled out the form with their answers. I have it configured to where the form emails the person a .PDF copy of the google but I would like it to send a word doc instead. Preferably a .DOCX. When I use the MimeType function, it only works when I use .PDF. If I put in any other file type extension i get an error. The form still populates a new doc in the folder but it won't send the email of that particular doc. Any suggestions on fixing these issues?
@julianaquist7765
@julianaquist7765 Жыл бұрын
I have the same image question. The URL as text passes fine, but how about getting that image to embed?
@electricaldepartmentarrdek171
@electricaldepartmentarrdek171 4 жыл бұрын
function autoFillGoogleDocFromForm(e) { //e.values is an array of form values var Timestamp = e.values[0]; var name = e.values[1]; var photo = e.values[2]; //file is the template file, and you get it by ID var file = DriveApp.getFileById('document/d/1fd1W0WX7rnraoPfDpDVqUt6gEIc9vOJ6-vJSSROKrqQ'); //We can make a copy of the template, name it, and optionally tell it what folder to live in //file.makeCopy will return a Google Drive file object var folder = DriveApp.getFolderById('1nFKe3KpIFGydfLupHb41RdKwB7k5hqPk') var copy = file.makeCopy(name, folder); //Once we've got the new file created, we need to open it as a document by using its ID var doc = DocumentApp.openById(copy.getId()); //Since everything we need to change is in the body, we need to get that var body = doc.getBody(); //Then we call all of our replaceText methods body.replaceText('{{name}}', name); body.replaceText('{{photo}}', photo); //Lastly we save and close the document to persist our changes doc.saveAndClose(); } TypeError: Cannot read property 'values' of undefined (line 3, file "Code") what i wrong?
@AntonBeerda
@AntonBeerda 4 жыл бұрын
I have the same error. It just stopped working (worked before). I haven 't figured out what happend.
@AntonBeerda
@AntonBeerda 4 жыл бұрын
I found why I got the error. My girlfriend, for whom I created this, accidentally deleted the folder where the automatically created files were stored :-) And thank you Jeff Everhart for this tutorial. My girlfriend is very happy with it as well.
@mcmarvellous
@mcmarvellous 2 жыл бұрын
How can I make it work for many data information, I mean having a lot of names and dates .... in google sheets and want them all be in one google doc table. I want to auto create invoices with one client buying many articles and its complicated for i hope you can help me with that. Thank you for all your efforts ❤❤
@jeffeverhart
@jeffeverhart 2 жыл бұрын
Check this out, it does something similar to what you are asking for: jeffreyeverhart.com/2020/05/18/open-letter-maker-with-google-forms-docs-and-apps-script/
@mcmarvellous
@mcmarvellous 2 жыл бұрын
@@jeffeverhart Thank you jeff you are the best !
@mikeshiroi3940
@mikeshiroi3940 3 жыл бұрын
Hi Jeff, firstly thanks very much for the great video, it was exactly what I was looking for. I created my own template made a few changes to your code and it worked perfectly..! However, I would prefer to store all my data in columns rather rows...How do I go about changing your code to achieve this?
@wadekmali
@wadekmali 3 жыл бұрын
Hi Jeff, loved the video! Is there any chance of building a bridge between Docs and Forms that when the form submits data it populates a new doc on an existing template?
@jeffeverhart
@jeffeverhart 3 жыл бұрын
Hi Kmali, that is pretty much what is described in the video. Let me know if you have any additional questions or I can point you to other resources.
@TheAshleyBaxter
@TheAshleyBaxter 4 жыл бұрын
Thank you! Thank you! Thank you! This was exactly what I needed, and taught so well. Greatly appreciated!
@jeffeverhart
@jeffeverhart 4 жыл бұрын
Awesome! Glad it was helpful. Thanks for watching, JE
@JoannaEnriquez-l2c
@JoannaEnriquez-l2c 7 ай бұрын
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!
@rebekaholiff9102
@rebekaholiff9102 Ай бұрын
Hi!! Just saw your video, and I’m looking to create a contract for my business , so the workflow I envision is Client fills out form > it then populates the contract with some of the info they already filled out in the form, but my question is what do I do about the info that I need to add manually? I guess just add it manually?😅
@JoePxxlouis
@JoePxxlouis 2 жыл бұрын
Thanks so much for this. My last line is giving me so much issues and wont let me trigger. it keeps saying Syntax error: SyntaxError: Unexpected end of input line: 51 file: Code.gs.............. I have everything typed correctly, what should i do? It aslo says I dont have any target functions. I dont know what else to do... Could my template not be in the right place?
@vbsmn8926
@vbsmn8926 3 жыл бұрын
I'm getting errors with the "e.values" part. Any thoughts on what the problem might be?
@robertbrown1338
@robertbrown1338 3 жыл бұрын
I am! not sure whats going on :(
@jeffeverhart
@jeffeverhart 3 жыл бұрын
A few reasons outlined here: jeffreyeverhart.com/2016/08/06/fix-typeerror-cannot-read-property-values-undefined/
@deisyhernandez495
@deisyhernandez495 Жыл бұрын
I can't find script editor! help someone
@lofiqueen24
@lofiqueen24 2 жыл бұрын
TypeError: Cannot read property 'values' of undefined autoFillGoogleDocFromForm @ Code.gs:2 Sir plz see this error is coming...what to do??...plz reply sir
@zytwn
@zytwn 3 жыл бұрын
Help! I've copied the script exactly but keep getting an error: "TypeError: cannot read property 'values' of undefined"
@jeffeverhart
@jeffeverhart 3 жыл бұрын
Check out this link to a blog post that describes that error: jeffreyeverhart.com/2016/08/06/fix-typeerror-cannot-read-property-values-undefined/
@AntonioPallotta-kj4fv
@AntonioPallotta-kj4fv 5 ай бұрын
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?
@Impuszu
@Impuszu 3 жыл бұрын
Hi. Anyone know why I've got error like that? TypeError: Cannot read property 'values' of undefined. Values are correct. I'm new at this stuff so sorry for stupid questions.
@kokaikchan9216
@kokaikchan9216 2 жыл бұрын
Thanks to your video, i tried it and it works! After that i try to add more feature to it, and it keep running error. At the end, i delete all the other code in my function,just keep the original code like yours, bt it still running error with error msg "driveapp is nt defined", hav you ever met this problem before? And how can i fix it? Ps sorry for my broken english
@kevinkeegan2025
@kevinkeegan2025 4 жыл бұрын
Hi Jeff! Thank you for the great video. When I go to add a trigger there is no "from spreadsheet" option for event source. Any idea why this might be and any recs on how I can fix this? Thanks!
@jeffeverhart
@jeffeverhart 4 жыл бұрын
Is the script attached to the spreadsheet and not the form? It needs to be in the spreadsheet.
@aaronwolf4726
@aaronwolf4726 4 жыл бұрын
@@jeffeverhart I had the problem and then realized that strangely when I went to create a trigger I had been switched to one of my different Google accounts. To fix this I just temporarily signed out of my other accounts and that fixed the problem.
@PeterBrand
@PeterBrand 3 жыл бұрын
@@jeffeverhart That solved it for me!
@redspectrenine9632
@redspectrenine9632 8 ай бұрын
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.
@rrijal19
@rrijal19 2 жыл бұрын
Hi Jeff, This is not working for me, Please help! I am getting an error. "TypeError: Cannot read property 'values' of undefined"
@philipcrawford3890
@philipcrawford3890 3 жыл бұрын
Can I make the output fit into the this google doc? I need it to be highlighted in the appropriate part of each box. Please let me know if it is too complex to try and do. I have some experience but not enough to know how to format the output correctly. docs.google.com/document/d/1oZeRu0S0vx5J8PLyggXOZ6RekCh4iUYPXrGlEV8-Dpk/edit?usp=sharing
@frenchcapitalmanagement814
@frenchcapitalmanagement814 2 жыл бұрын
Since the creation of this video, I can't find Script Editor under TOOLS in Google Sheets. What's the updated procedure?
@pranavsathi6709
@pranavsathi6709 2 жыл бұрын
Hey Jeff, again, amazing tutorial! I was wondering whether we could fill out a Google Sheet with the data instead of a Google Doc.
@Andrewzwyatt
@Andrewzwyatt Жыл бұрын
Is it possible to take this one step further, and convert the DOC to PDF. And then automate an email with the pdf attached?
@if9938
@if9938 2 жыл бұрын
the 'e' value is undefined. how do i make this work?
@rogofever
@rogofever 5 ай бұрын
Facing the same issue what did i do wrong
@timothydavey8796
@timothydavey8796 2 жыл бұрын
why can't there just be a button in Google Forms that says export to Google Docs, (or something similar...
@courtneym1973
@courtneym1973 3 жыл бұрын
Ugh I tried this video too and didn’t work. Got through all the code but it didn’t pull my variables into my doc…..
@aidilasyraff05
@aidilasyraff05 2 жыл бұрын
Is there any idea why am I getting "document is inaccessible. Please try again later." ? What should I do
@believeinheroes
@believeinheroes Жыл бұрын
Very helpful, but every so often (maybe 10% of the time) the form submission will fail to trigger the document creation, and nothing gets logged. Is there a way to re-run the trigger for the most recent form submission? Currently, if I try to manually re-run the trigger, I get an error, "TypeError: Cannot read properties of undefined (reading 'values')". I assume this is because it's going to the next line on the spreadsheet, which is blank. EDIT: I ended up using your follow-up video, "Auto Fill Google Doc Template from Google Sheets Data Using Google Apps Script". That method works as a workaround for when the form submission trigger fails.
@yousafsimba4525
@yousafsimba4525 2 жыл бұрын
IS THERE ANY WAY, WE GET GOOGLE FORM FIELDS AUTOFILLED FROM GOOGLE SHEET VALUES (NOT WITH PREFILLED LINKS)
@stevenkontsevenkofilms
@stevenkontsevenkofilms 2 жыл бұрын
I am having an issue with replacing the text in the Header. The code I used was: var body = doc.getHeader(); body.replaceText("{{Name}}", name); body.replaceText("{{Whatever is on my Doc}}", with one of the fields from the form); I used to use this but it no longer works. How do I replace the text in the Header with the text entered in the form? Thank you
@annasaysthings
@annasaysthings 3 жыл бұрын
Thank you so much! I can't believe Google hasn't made a proper function between form and doc yet. I came here to learn this because I was trying to make one-link access to a form on my Role Playing Discord, for people to submit their Original Characters for roleplay, and then THAT response into a reference doc that I could share with all the players on discord about each player. Woo!
@jeffeverhart
@jeffeverhart 3 жыл бұрын
Awesome! I'm glad this worked well for you. Thanks for watching!
@LuckAqua
@LuckAqua 3 жыл бұрын
The code is very wrong. The e.values[0] will return time string (not timestamp) and e.values[1] and e.values[2] will always return null.
@jeffeverhart
@jeffeverhart 3 жыл бұрын
Tons of other people have used this example without issue. If your form is different, then the values accessible in e.values will be different as well.
@LuckAqua
@LuckAqua 3 жыл бұрын
@@jeffeverhart No. You suppose the e.values will contain all submitted values, but they usually won't. If you want to get values, you should get active range of the active sheet or form response from the timestamp which was given in e.values[0]. Your example is not a good practice. Tons people can use it not mean it's a perfect answer. I thumb down for the way you get response value. Other codes are OK. Thanks
@jeffeverhart
@jeffeverhart 3 жыл бұрын
I felt like I needed to post some additional clarifications to this to explain how I approach things in case anyone else reads this comment. Please know that I appreciate your comments, and am not trying to be rude in anything that follows: you are clearly allowed to define "best practice" however you want, but I define "best practice" in programming as using the clearest way of doing something afforded to us by the language or environment. Yes, I could read the timestamp and go to the sheet and get that range and the subsequent values, but Google gives us those event objects for a reason, and that reason is so that our code is simpler. In fact, if you look at the docs created by Google, they use the event object to handle incoming data from the form in a very similar example. However, that's not to say there aren't use cases where your approach might not be better. For example, if there are calculations you want to make in the sheet instead of apps script, obviously we would need to get that data from the sheet. In the case that you are resubmitting the form, yes only the resubmitted values would appear in the event object, but that is a totally different use case that would also require lots of changes to the codes that copies and fills Google Docs. Clearly, what is in the video didn't work for you, which is fine, but to throw up the "best practice" flag is disingenuous. Best practice depends on what you are trying to do and the constraints imposed by your particular use case, and that is what makes programming so hard because at that level of granularity there are much fewer real "best practices." Again, I appreciate any and all comments here because they help me dig deeper into Apps Script, but I felt like I needed to elaborate my position on how I approach this stuff for people who might read this thread in the future. Thanks for watching and taking the time to comment. Regards, Jeff developers.google.com/apps-script/quickstart/forms developers.google.com/apps-script/guides/triggers/events#form-submit
@LuckAqua
@LuckAqua 3 жыл бұрын
@@jeffeverhart Thanks for the clarification. The e.values not return values in my case, so that's not the best practice to get values from submissions. My form has more than 100 fields and be edited usually and allows multiple submissions then the e.values and e.namedValues are never returned as the documentation said. You can easily repeat this case by editing fields of the 100 field form when a submission is being processed or submit a new submit when a submission is being processed. Check it with Logger and everything will be clear. Regards.
@wollodge
@wollodge Жыл бұрын
Video was great and I understand everything. However, I keep getting a TypeError: Cannot read properties of undefined (reading 'values' ) I watched the video a few times and don't see where I'm making a mistake. Thanks for any help you can provide.
@jeffeverhart
@jeffeverhart Жыл бұрын
Check out this post here: jeffreyeverhart.com/2016/08/06/fix-typeerror-cannot-read-property-values-undefined/
ПРИКОЛЫ НАД БРАТОМ #shorts
00:23
Паша Осадчий
Рет қаралды 6 МЛН
Стойкость Фёдора поразила всех!
00:58
МИНУС БАЛЛ
Рет қаралды 3,3 МЛН
Do you choose Inside Out 2 or The Amazing World of Gumball? 🤔
00:19
Google Forms Tutorial
29:15
Kevin Stratvert
Рет қаралды 1,2 МЛН
Google Forms to PDF & Email while storing data in Google Sheets
27:02
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 166 М.
Fillable Document  - How to make any Google Doc as Fillable Form
15:34
Fillable Document - Jivrus Technologies
Рет қаралды 194 М.
Google Forms - Drop Down List from Spreadsheet Using Apps Script
34:39
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 443 М.
Autofill Google Doc Template from Google Sheets | Google Apps Script
5:34
Retrieve Rows from Google Sheets with Google Apps Script
19:12
Jeff Everhart
Рет қаралды 41 М.
Google Sheets Web App Example - Google Apps Script Web App Tutorial - Part 1
31:41
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 796 М.
Autofill Google Forms Using Google Sheets #googleform
5:31
Data In Nut Shell
Рет қаралды 6 М.
Automate emails with Google Forms and Google Apps Script
36:42
Matt Brigidi
Рет қаралды 17 М.
ПРИКОЛЫ НАД БРАТОМ #shorts
00:23
Паша Осадчий
Рет қаралды 6 МЛН