Auto Fill Google Doc from Google Form Using Google Apps Script

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 พ.ย. 2024

ความคิดเห็น • 485

  • @HighGravityHipHop
    @HighGravityHipHop 2 ปีที่แล้ว +4

    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!

  • @Uh-e8r
    @Uh-e8r 9 หลายเดือนก่อน +5

    how can you declare (e) ??? it is not working when i try this script

  • @l2OI3
    @l2OI3 4 ปีที่แล้ว +16

    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 ปีที่แล้ว +1

      @@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 ปีที่แล้ว +1

      Yes thank you

    • @ZayedDabaja
      @ZayedDabaja 3 ปีที่แล้ว

      @@jeffeverhart please make more complicated stuff for appscript

    • @jeffeverhart
      @jeffeverhart  3 ปีที่แล้ว +1

      Thanks, any thoughts on what topics you'd like to see covered?

  • @justthoughts8254
    @justthoughts8254 ปีที่แล้ว +2

    I love how you went over each code line by line

  • @imperfectbujo1766
    @imperfectbujo1766 ปีที่แล้ว

    Jeff, 2 years after you posted, I was able to follow along and increase my paperwork productivity. Amazing. Now I have to research how to use a drop-down menu to print more extensive verbiage.

    • @jeffeverhart
      @jeffeverhart  ปีที่แล้ว

      Awesome, glad this helped you out

  • @furiousflower
    @furiousflower 3 ปีที่แล้ว +6

    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!

  • @annasaysthings
    @annasaysthings 4 ปีที่แล้ว +1

    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  4 ปีที่แล้ว

      Awesome! I'm glad this worked well for you. Thanks for watching!

  • @hoang16191
    @hoang16191 5 หลายเดือนก่อน +2

    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?

  • @verko1176
    @verko1176 4 ปีที่แล้ว

    Thank you for this!
    I am a middle school teacher and in the course of less then an hour, I was able to make a form, and edit a template for lesson plans. It should save me dozens of hours in the future!

    • @jeffeverhart
      @jeffeverhart  4 ปีที่แล้ว

      Awesome, Jason! Always glad when I can help a teacher save some time in the classroom.

    • @verko1176
      @verko1176 4 ปีที่แล้ว

      @@jeffeverhart I see so many other possibilities..
      I could make Google Form and have it fill out an Essay even. The possibilities are endless!

  • @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.

  • @palmermiddle5804
    @palmermiddle5804 4 ปีที่แล้ว +9

    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

  • @ARIFMAULANADANANJAYA
    @ARIFMAULANADANANJAYA ปีที่แล้ว +5

    nice video, question
    TypeError: Cannot read properties of undefined (reading 'values')
    how to fix that?

    • @drbavithrandeda6569
      @drbavithrandeda6569 4 หลายเดือนก่อน

      even I got the same when I tried today , got any fix for it ?

  • @mayonvolcano4404
    @mayonvolcano4404 2 ปีที่แล้ว +4

    I got an error saying that the e and the other values from e is undefined

  • @rainohansen6813
    @rainohansen6813 4 ปีที่แล้ว

    15 minutes video = 3 lessons anticipated in the class room with rookies. I have 80 this year, so I should branch out for the German speaking students on the part vocational track towards a trainee position. I should be able to use the "title" to demonstrate the possibility of formatting the text for the more casual tone in Switzerland of maskuline and feminine in the text, to deviate from the unisex polite standard German "Sie" .
    A completed traineeship is for several topics qualifying for the University acceptance, including ETH Zürich.

  • @davidkrupski7879
    @davidkrupski7879 4 ปีที่แล้ว +1

    Great job Jeff. I really appreciate the walk through. I am a school leader and I wanted an easy way to create walk through forms to then populate them and then I could send them to the teachers in my building. Thank you so much!

    • @jeffeverhart
      @jeffeverhart  4 ปีที่แล้ว

      Thanks so much for the kind words! Always glad when I can help teachers save time!

    • @santosrodrigueziiikimbarke2138
      @santosrodrigueziiikimbarke2138 3 ปีที่แล้ว

      Hi, I am working on something similar. But I would like to send an email of the doc created to the teacher. Any help would be greatly appreciated. Thank you

  • @denisstpierre7140
    @denisstpierre7140 3 ปีที่แล้ว +2

    Thank You for this walk through. Clear, organized and Concise! Really helped me see what is possible with Apps scripting. 👌

  • @fikrikasmani4912
    @fikrikasmani4912 ปีที่แล้ว +1

    Tried used it but get error cannot read properties of undefined (reading 'values'...

  • @albertsimpkins2544
    @albertsimpkins2544 3 ปีที่แล้ว +3

    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.

  • @yeerehneh
    @yeerehneh 2 ปีที่แล้ว

    u saved so much time for me and my internship. thank you!

  • @katdancer8752
    @katdancer8752 3 ปีที่แล้ว +1

    Finally. I have been looking for this solution. Thanks for the explanation Jeff.

    • @jeffeverhart
      @jeffeverhart  3 ปีที่แล้ว

      you are welcome. Thanks for watching!

  • @jessicaseger945
    @jessicaseger945 2 ปีที่แล้ว

    I've used this tutorial before to auto fill a google doc from a form, but I'm wanting to put my doc template in a google sheet. The main purpose is for that sheet to look similar to a doc if I were to print but to also have the ability use the "sum" function available in a sheet to add up info that will be added after the sheet is auto created from the script.

  • @dabeldasac921
    @dabeldasac921 2 ปีที่แล้ว

    The best, easiest, simplest explanation i'v ever seen!
    Thank you so much1

  • @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.

  • @TheTramos00
    @TheTramos00 2 ปีที่แล้ว

    Nice video. I took it as a base of a project using a sheet template instead. As several users will be sending responses at the same time, I preferred to use batch processes with triggers.

  • @analuciaalegre735
    @analuciaalegre735 2 ปีที่แล้ว +1

    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!!

  • @idoaikerja1187
    @idoaikerja1187 2 ปีที่แล้ว +1

    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?

  • @CebuVisionaryConstruction
    @CebuVisionaryConstruction 20 วันที่ผ่านมา

    Hi Jeff! Your tutorial is amazing! Easy to understand and to follow. I'm just wondering if you also have a video on how to add the actual photos uploaded in Google Forms to the Google Doc? I have created a daily site report form that requires images from our project site. I want to see those images in the report in the Google Docs so I can just print it out and submit to our client

  • @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?

  • @maryteel4578
    @maryteel4578 2 ปีที่แล้ว +1

    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!

  • @orangerfire
    @orangerfire 3 ปีที่แล้ว

    This is fanstastic, easy to use. One question, I got it working great except it duplicates on form submission and creates two identical docs in my destination folder. any thoughts on what I goofed up?

  • @mcmarvellous
    @mcmarvellous 3 ปีที่แล้ว +1

    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  3 ปีที่แล้ว +1

      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 3 ปีที่แล้ว

      @@jeffeverhart Thank you jeff you are the best !

  • @rubiks1kid
    @rubiks1kid 2 ปีที่แล้ว +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 2 ปีที่แล้ว

      I have the same image question. The URL as text passes fine, but how about getting that image to embed?

  • @rebekaholiff9102
    @rebekaholiff9102 3 หลายเดือนก่อน

    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?😅

  • @krstn_xxi
    @krstn_xxi ปีที่แล้ว

    Thanks for the video! What about in the case of uploaded images in Google Forms?

  • @hebyurinonog2524
    @hebyurinonog2524 3 ปีที่แล้ว

    Thanks for the tutorial. I have one question, does the table in the google doc append whenever someone submits a form or it will go to a new google doc?

  • @Dillon1919
    @Dillon1919 ปีที่แล้ว

    This has been a great help, I am wondering if it is possible to save the doc to a specific folder and that folder would be correlated to a name from a drop down inside of the form itself?

  • @richbraithwaite
    @richbraithwaite 3 ปีที่แล้ว

    Thanks Jeff, have got this working for my own form - brilliant. However, is there a piece of code that can be included in the script to autoprint the newly created files?

  • @danielalejandrocordovadela657
    @danielalejandrocordovadela657 2 ปีที่แล้ว +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?

  • @Darjay0905
    @Darjay0905 หลายเดือนก่อน

    Thank you for the knowledge. How do I make this successful TypeError: Cannot read properties of undefined (reading 'values')?

  • @RohitSharma-nh5ti
    @RohitSharma-nh5ti 2 ปีที่แล้ว

    Hi Thomas! Thnak you for creating this video. I have followed it and created my script but for some reason it is not population into the google doc I want it to. Any suggestions?

  • @mazettipedro
    @mazettipedro 7 หลายเดือนก่อน

    Man, I can't believe this worked, thank you so much.

    • @jeffeverhart
      @jeffeverhart  6 หลายเดือนก่อน

      Awesome, thanks for watching!

  • @hmacwork
    @hmacwork ปีที่แล้ว

    Hi, it is a great video. Can I add an extra column in the spreadsheet which will replace the additional placeholder of the template? The extra column is not available in the google form.

  • @AntonioPallotta-kj4fv
    @AntonioPallotta-kj4fv 7 หลายเดือนก่อน

    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?

  • @wadekmali
    @wadekmali 3 ปีที่แล้ว +2

    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 ปีที่แล้ว +2

      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.

  • @deisyhernandez495
    @deisyhernandez495 2 ปีที่แล้ว +1

    I can't find script editor!
    help someone

  • @jamesperlman33
    @jamesperlman33 2 ปีที่แล้ว

    Jeff, thanks so much for this tutorial. Well presented, clear and it worked for my Form processing. Much appreciated.

  • @_sherps2831
    @_sherps2831 4 ปีที่แล้ว

    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.

  • @lyzziebeth
    @lyzziebeth 2 ปีที่แล้ว

    Great video for me to understand, a non-engineer! I do have one question - I have a question on the Google Form that is a multiple check box option so that translates to it inputting the title to "Example [1st choice]". How do I put in the var function since it doesn't recognize the brackets and also because I can't change the titles for the columns in Sheets? Thanks in advance!

  • @ciaranmchugh6760
    @ciaranmchugh6760 3 ปีที่แล้ว

    Hi, thank you for this tutorial. One question I hope you can answer: instead of generating new templates for every new form responses, how can I add new forms response data to existing docs depending on the options chosen in the docs (example: person A selects it's them filling out the form in the first option, so everything thereafter gets added to their specific doc template?!). I really hope you can help! Thank you

  • @jsmith0121
    @jsmith0121 4 ปีที่แล้ว

    How does it know which spreadsheet to pull data from? When you're in Sheets, and you click Tools -> Script Editor, does it automatically assume you want to pull data from that spreadsheet? I'm having issues because I've parsed out my data into separate sheets and want to pull data from those, but they share the same file ID as the original. Is there a way to specify that I want the function to look at another sheet within the workbook?
    Great video, btw. I'm very new to all of this script language, but this was just what I needed.

    • @jeffeverhart
      @jeffeverhart  4 ปีที่แล้ว

      In this example, the script doesn't actually pull data from the sheet so much as it is passed into our script from the form submission event. To access different sheets, you can use 'SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Name of Sheet")' to select a specific sheet in a workbook. From there, I recommend you check out my post on getting data from Google Sheets: jeffreyeverhart.com/2019/03/01/retrieve-rows-from-google-spreadsheet-with-google-apps-script/

  • @trentladle6623
    @trentladle6623 ปีที่แล้ว

    I have checkboxes and multiple-choice responses mixed with text responses in a Google form. Following your video, I'm getting responses on the newly created document on questions 1-5 and then I stop getting the responses on question 6 which is a select all that apply checkbox response. Question 7 is a text response and then question 8 is again a select all that apply checkbox response. What do I need to enter for the checkbox responses to be added to my document and if there are multiple checkboxes selected how can they be separated by a comma? I found a comment on your website about using the textToPrint command but I think my situation is different? And how would I code for the multiple-choice responses? Thanks in advance.

  • @AmboyAgTeacher
    @AmboyAgTeacher 2 ปีที่แล้ว

    I got the following message when I clicked on "run" after following your instructions. TypeError: Cannot read property 'values' of undefined (line 2, file "Code")
    This is my line 2-
    var timestamp = e.values[0];
    Do you have any suggestions?
    Also, I am playing around with the triggers etc. Is there a way to get a document to generate and appear in the folder for a form response that was already submitted? For example, I tried putting a trigger for On Edit, and On Change, and On Open. I then proceeded to close and re-open the response spreadsheet, and edit one of the phone numbers on a response that was submitted before I created this script, and nothing happened that I can see. I have 2 people who have already submitted, and when I do a test one it works, but I don't want to ask my people to resubmit the form, nor do I want to type all their info just to get it into a document, was hoping for a way to grab those old ones and make them transfer.
    Upon playing with the different triggers, I believe it sent the Summary of Failures email to me at those times with more info on the Error, the email says the following:
    TypeError: Cannot read property '0' of undefined
    So I am not sure what I am missing, but the rest works fine when a new form is filled out and submitted, just don't know why there is a small error in there somewhere?
    Thanks for a very helpful and informative video for someone who has never done anything like this before! I would love to learn more!

  • @LuckAqua
    @LuckAqua 4 ปีที่แล้ว

    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  4 ปีที่แล้ว

      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 4 ปีที่แล้ว

      @@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  4 ปีที่แล้ว

      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 4 ปีที่แล้ว

      @@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.

  • @zytwn
    @zytwn 4 ปีที่แล้ว +1

    Help! I've copied the script exactly but keep getting an error: "TypeError: cannot read property 'values' of undefined"

    • @jeffeverhart
      @jeffeverhart  4 ปีที่แล้ว

      Check out this link to a blog post that describes that error: jeffreyeverhart.com/2016/08/06/fix-typeerror-cannot-read-property-values-undefined/

  • @littlediscoverer8797
    @littlediscoverer8797 3 ปีที่แล้ว +1

    Super useful, concise, and easy to follow. Thank you!

    • @jeffeverhart
      @jeffeverhart  3 ปีที่แล้ว

      Thanks for watching! I'm glad it was helpful

  • @savannamcgill8942
    @savannamcgill8942 3 ปีที่แล้ว +1

    Hi Jeff, Great video! I'm not sure if this question has been answered but I have a template made in docs that I make a copy of each time I need to fill it out. Is it possible with this method to have it autofill a new copy from a pre-made template? Basically, I need a new doc created from every form submission from a template that's already been created.

    • @wadekmali
      @wadekmali 3 ปีที่แล้ว

      I'm working towards the same thing, please let me know if you figure it out! Good luck!

    • @savannamcgill8942
      @savannamcgill8942 3 ปีที่แล้ว

      @@wadekmali This seems to be the closest thing I can find. th-cam.com/video/TSDXfdo3JVU/w-d-xo.html I haven't had a chance to try it as I am still awaiting admin approval but if you do, let me know!

    • @jeffeverhart
      @jeffeverhart  3 ปีที่แล้ว

      If you look at the video at this timestamp, the script does make a copy of the original template. This creates a new doc per submission, and keeps the original: th-cam.com/video/ziLtj5-_D7c/w-d-xo.html

  • @if9938
    @if9938 2 ปีที่แล้ว +1

    the 'e' value is undefined. how do i make this work?

    • @rogofever
      @rogofever 7 หลายเดือนก่อน

      Facing the same issue what did i do wrong

  • @trobinson3girls
    @trobinson3girls หลายเดือนก่อน

    Thank you so MUCH! Everything worked great. I ran into a problem. I completed these tasks to complete data walks on staff but I am stuck because I do not know how to auto share the doc I recreated from the responses. I am the responder because I am the one completing the form. How can I auto email each person their results.

  • @kevinkeegan2025
    @kevinkeegan2025 4 ปีที่แล้ว +2

    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 ปีที่แล้ว +2

      Is the script attached to the spreadsheet and not the form? It needs to be in the spreadsheet.

    • @aaronwolf4726
      @aaronwolf4726 4 ปีที่แล้ว +2

      @@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!

  • @masonparnell2982
    @masonparnell2982 3 ปีที่แล้ว

    Is there any way to generate responses into the Doc from a checkbox of items on the Form, inserting only the items checked? Does that make sense? Thank you for the great tutorial! I am working on creating this for my team.

  • @meryemormanc2705
    @meryemormanc2705 4 ปีที่แล้ว +2

    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: th-cam.com/video/iLALWX0_OYs/w-d-xo.html
      Thanks for watching!

  • @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?

  • @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/

  • @YuriCordeiro
    @YuriCordeiro 3 ปีที่แล้ว

    Thank you very much for the video! It worked super! One question: I have a table with thirty possible lines, which will not always be filled. Is there any way that, if the form field is blank, the document is also blank?

    • @jeffeverhart
      @jeffeverhart  3 ปีที่แล้ว +1

      If you just pass a blank value into the replaceText function it will replace the tag with the blank value, so that can work depending on what your doc is set up like

  • @asherforrester7008
    @asherforrester7008 3 ปีที่แล้ว

    Great video !! Could the replacement function work with a multiple choice question submission from a form ? I've noticed that multiple values in a single cell are separated by a comma ?

    • @jeffeverhart
      @jeffeverhart  3 ปีที่แล้ว +1

      Yes, you would need to split the text on the commas and then reconstruct how you want the multiple values to be displayed

  • @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

  • @TheAshleyBaxter
    @TheAshleyBaxter 4 ปีที่แล้ว +3

    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

  • @vbsmn8926
    @vbsmn8926 3 ปีที่แล้ว +1

    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/

  • @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?

  • @ghostling78
    @ghostling78 4 ปีที่แล้ว +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?

  • @mikeshiroi3940
    @mikeshiroi3940 3 ปีที่แล้ว +2

    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?

  • @miguelbautista5031
    @miguelbautista5031 4 ปีที่แล้ว

    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  4 ปีที่แล้ว

      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/

  • @shanebates1568
    @shanebates1568 4 ปีที่แล้ว

    Super helpful. To take it further, do you know if you can have multiple functions that correspond to their own different google doc templates based on an answer given in google form? For example, if you had a drop down question in google forms, could you have a different google doc template for each option in the drop down question that is only activated when that answer is submitted on form submission?

    • @jeffeverhart
      @jeffeverhart  4 ปีที่แล้ว

      Yeah, you could for sure do that. You would need to use conditional logic in the same function to determine which template is used and replaced. I would recommend looking at the JavaScript Switch operator for that. Thanks for watching!

    • @shanebates1568
      @shanebates1568 4 ปีที่แล้ว

      @@jeffeverhart Iv been learning a lot about conditional logic, but haven't been able to apply it successfully to the script in this video. any suggestions of syntax that will allow for? this?

  • @pranavsathi6709
    @pranavsathi6709 2 ปีที่แล้ว +1

    Hey Jeff, again, amazing tutorial! I was wondering whether we could fill out a Google Sheet with the data instead of a Google Doc.

  • @andrewlawrence4231
    @andrewlawrence4231 3 ปีที่แล้ว

    Thanks Jeff. I tried it exactly as you have explained and get the error message: Exception: Unexpected error while getting the method or property getFolderById on object DriveApp.
    I tried copying and pasting the folder id again and even making a new folder and still won’t work. Any advice?

  • @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?

  • @chiherr
    @chiherr หลายเดือนก่อน

    I want this but instead it's from Google Sheets. Is that possible? I have data in sheets then I want to create reports in docs? I want 1 page (doc) per row (sheet).

  • @SirveraCox
    @SirveraCox ปีที่แล้ว

    So this video work perfect and I have used it. But I am needing help because my google doc is more complex with check boxes to match the google form. How can I add that to my app script to check the boxes on the doc like the google form?

  • @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

  • @wessumner8877
    @wessumner8877 2 ปีที่แล้ว

    Everything appears to work except for the replaceTest part. Thoughts?

  • @antifolkhero
    @antifolkhero 2 ปีที่แล้ว

    Is there a way to get lots of responses to populate into a Google doc instead of a spreadsheet? I need a lot of information from people to automatically go to certain places on a specific form, but not a spreadsheet.

  • @abhishekborade5303
    @abhishekborade5303 3 ปีที่แล้ว +1

    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/

  • @TheMandawes
    @TheMandawes 3 ปีที่แล้ว

    Thank you for this! I'm trying to do it for salaries. The google sheets cells are formatted to have currencies but the currency sign and comma of the numbers are not translating to google docs. Any tips?

    • @TheMandawes
      @TheMandawes 3 ปีที่แล้ว

      Oops I posted on the wrong video. I'm referring to your Google Sheets -> autofill Google Docs tutorial.

    • @jeffeverhart
      @jeffeverhart  3 ปีที่แล้ว

      Sorry for the late reply. Check the linked blog post on that video for more details, but basically you need to use .getDisplayValues instead of .getValues if you want spreadsheet formulae applied.

  • @HRResidency
    @HRResidency 8 หลายเดือนก่อน

    thanks for the tutorial.... what is the code for upload a image?

  • @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?

  • @alvinchow3002
    @alvinchow3002 9 หลายเดือนก่อน

    Jeff, can we auto fill image to the docs after image upload respond in google form?

  • @chirayuvyas4393
    @chirayuvyas4393 ปีที่แล้ว

    This will save me so much time Jeff! Kudos

  • @conroywill
    @conroywill 3 ปีที่แล้ว

    Are you able to do If statements in the word document like you can in MailMerge?

  • @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

  • @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?

  • @JoannaEnriquez-l2c
    @JoannaEnriquez-l2c 9 หลายเดือนก่อน

    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!

  • @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.

  • @sophiemathewson3437
    @sophiemathewson3437 ปีที่แล้ว

    Hi Jeff, very helpful video - thank you! Wondering if there is a way to then send the completed Google Doc as either a Google Doc or a pdf for the person that filled out the Google Form. (one of the Google Form questions would be email address). Looking forward to your reply.

  • @boruprattmccullagh8339
    @boruprattmccullagh8339 4 ปีที่แล้ว

    This is extremely useful - thank you. A question: When I go to add the trigger, I cannot select a spreadsheet as the event source. Do you know why this would be and how I can fix this?

    • @jeffeverhart
      @jeffeverhart  4 ปีที่แล้ว

      Is the script attached to the spreadsheet via the script editor? What options are you seeing?

    • @boruprattmccullagh8339
      @boruprattmccullagh8339 4 ปีที่แล้ว

      @@jeffeverhart I opened up the script editor from the 'Tools' heading in Sheets (same as you did) but can't see anything on the script editor to link it to my FormResponse Sheet. How would I attach the script to the sheet? TIA

    • @jeffeverhart
      @jeffeverhart  4 ปีที่แล้ว

      @@boruprattmccullagh8339 If you create a new script via the script editor that is attached to the sheet, that should link the script and sheet automatically

    • @boruprattmccullagh8339
      @boruprattmccullagh8339 4 ปีที่แล้ว

      @@jeffeverhart Got it working! Thanks again for the vid

  • @flylikeaniceguy
    @flylikeaniceguy 3 ปีที่แล้ว

    Is there anyway to populate a table located in your header that already has some data filled in example: company logo and company name are filled in but I have 6 other rows that need filled

  • @christiansotelo2543
    @christiansotelo2543 6 หลายเดือนก่อน

    Just wanna know if this applicable if i have an existingntemplate fill it in docs?

  • @emrahoz07
    @emrahoz07 ปีที่แล้ว

    Thanks for the good information. We look forward to the continuation.

  • @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.

  • @rezendenetto
    @rezendenetto 2 ปีที่แล้ว

    Your videos are amazing man...
    Is there any content in your channel teaching how to import data from MYSQL to Google Sheets?

  • @courtneymilleson2374
    @courtneymilleson2374 3 ปีที่แล้ว

    Hello and thank you for the introduction to Google Apps Script. I am trying to make an auto-fill Google Doc from Google Form. I've followed the video (and copied and pasted the script from the blog post) but I'm still running into an error: "TypeError: templateFile.makeCopy is not a function". I am using the newer version of the Scripts, is that a portion of the reason? I am highly convinced it's my error causing the issue. (And in reading others comments, ACK! I am a dolt!) Any ideas on what I may be doing wrong?