Google Forms to PDF & Email while storing data in Google Sheets

Поділитися
Вставка
  • Опубліковано 30 вер 2024

КОМЕНТАРІ • 573

  • @namwan.c6947
    @namwan.c6947 Рік тому +8

    Thank you very much for your tutorial. As of the present (2023), some methods in the code cannot be used, such as the "removeFile" function, which can be replaced by using the "setTrashed(true)" method.

  • @roomforrentcuba
    @roomforrentcuba 3 роки тому +28

    Dude, you have absolutely no idea about how much easier my life has become since I found you. Of course it takes a little bit of time and brains to understand what you are explaining and adapt it to my specific needs (I'm no programmer), however... the time that this automations are earning me is countless,. My life is much easier now thanks to you. Thank you my friend, please, keep up the good work, we need you, hahaha :)

  • @dr.mohammedmohammed7633
    @dr.mohammedmohammed7633 3 роки тому +2

    Could you please update this vedio by new vedio... because i think the script need update or something... i try many times... please could 🙏 you update by new one

  • @thanakornsairat8711
    @thanakornsairat8711 3 роки тому +4

    i've been having an error saying Cannot read property 'namedValues' of undefined can anyone help?

  • @cheskavillanueva5772
    @cheskavillanueva5772 4 роки тому +30

    Awesome! Plese don't get tired of doing more videos like this! Maybe you can share the script as well? Heh. :)

  • @fdphy
    @fdphy 2 роки тому +4

    Thank you for this Tutorial, I had trouble deleting the temp Document. But on looking through the references the removeFile() method in tempFolder.removeFile(newTempFile); is depreciated. So all temp Documents end up on the root folder. A new way delete is rather simple, just use newTempFile.setTrashed(true);

  • @gravityelements14
    @gravityelements14 2 роки тому +3

    TriggerEvent step seems to have changed since you made this video. Google sheet form submit event shows a caution message “make sure you use this form submit trigger with SpreadsheetTriggerBuilder”. I am unable to pass googlesheet info data - that comes from google form - to google doc variables using event trigger. Any advise?

  • @markestillero688
    @markestillero688 11 місяців тому +3

    Hi, i have encountered an error during e.namedValues. It has an error which states: TypeError: Cannot read properties of undefined (reading 'namedValues'_

  • @bobykumar3960
    @bobykumar3960 3 роки тому +6

    MAY BE ONE DAY I HAVE THE HONOUR OF MEETING YOU..

  • @MuamarRahmanto-yt7er
    @MuamarRahmanto-yt7er 7 місяців тому +1

    we need you to remake this video with current google script and app

  • @nikluz3807
    @nikluz3807 4 роки тому +8

    I want to sincerely thank you for all of these tutorials. I got my degree last year and have been working with Google suite for several years now and just scored my first freelance programming job building an application in Google suite for a company

  • @Momochai
    @Momochai 2 роки тому +1

    TypeError: Cannot read property 'namedValues' of undefined
    at formSubmit(Code:2:18)

  • @ridingwithcharley6821
    @ridingwithcharley6821 2 роки тому +3

    With a little work, I was able to use this basic outline, modify it a little, and create an actual working invoice I can create from my phone that is ready to email without having to be near a printer and computer. I can now create an invoice immediately and email when I have finished the work order. Thanks for the video's... so much better than other YT channels.

  • @jeanalencar7297
    @jeanalencar7297 2 роки тому +1

    Error, function makeCopy

  • @taufikismail4704
    @taufikismail4704 4 роки тому +11

    Thank you for this awesome tutorial. I have a question. What if the respondent have to upload an image to the form which will be appear as gdrive link in spreadsheet. Then I want to show the image submitted in the PDF.

    • @narendranathansk5918
      @narendranathansk5918 3 роки тому +1

      Dear Sir kindly the solution for this question. Also resize of image that need to be fit in the template.

    • @julianasasantos
      @julianasasantos 2 роки тому

      Did you learn how to do that?? I need it too

  • @mustaphasaadi6093
    @mustaphasaadi6093 3 роки тому +1

    thanks for the video
    i followed all your steps but i have a probleme the PDF FILE does not get ceated only the temp file

  • @PavanKumar-gg8jq
    @PavanKumar-gg8jq 2 роки тому +1

    will it be possible to create pdfLink directly from google sheets without using trigger or after form submission function? Directly to generate pdflink in the google sheet and store the generated link in the pdfLink cell.

  • @SVBP
    @SVBP 6 місяців тому

    its not working for my now. showing error ['First Name'] and etc., plz help me

  • @WINNERS-TECH
    @WINNERS-TECH 9 місяців тому +1

    Hi its not working for me , Its showing an error like templateDoc.makeCopy() NOT A fUNCTION

  • @kanzadanurkamilova4584
    @kanzadanurkamilova4584 3 роки тому +1

    Please, does anyone know how this works?
    What should be in place "namedValues"
    This code gave me error: TypeError: Cannot read property 'namedValues' of undefined
    function afterFormSubmit(e) {
    const info = e.namedValues;
    const pdfFile = createPDF(info);
    const entryRow = e.range.getRow();
    const ws = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("IS")
    ws.getRange(entryRow, 32).setValue(pdfFile.getUrl());

    sendEmail(e.namedValues['Email'][0],pdfFile);
    }

  • @lukas071196l
    @lukas071196l 2 роки тому +1

    Hello, I'm having an issue related to non required information.
    Whenever I try to use this code and my forms don't have any information in a cell, it keeps showing this error: T"ypeError: Cannot read property '0' of undefined"
    What can I do?

    • @diditaxinl8099
      @diditaxinl8099 2 роки тому

      Make sure you are not replacing the text which is not sent from the form.
      And you should run the script by using the trigger, don't run inside the editor, but run it by submitting the form

  • @germanescobar263
    @germanescobar263 3 роки тому +1

    Hello, I have checked all code many times but I arrived at the same point , I have the following error, could somebody help me, what's is going on ?
    2:47:44 PM Error
    TypeError: Cannot read property 'namedValues' of undefined
    afterFormSubmit @ Code.gs:3

    • @nomadlivecast9708
      @nomadlivecast9708 3 роки тому +1

      Hi ! Awesome tutorial ! same here... any solution ? i've restarted 3 times the tutorial 3 times and still
      TypeError: Cannot read property 'namedValues' of undefined

  • @Ttnit2012
    @Ttnit2012 3 роки тому +1

    Can this code modify for run without Form Submit - etc. run after click "RUN"

  • @vibumontaj3433
    @vibumontaj3433 3 роки тому +1

    Error
    TypeError: Cannot read property 'namedValues' of undefined
    afterformSubmit @ Code.gs:2

    • @jayasri-ft8040
      @jayasri-ft8040 2 роки тому

      Hi. Did you fixed that error. If you have fixed let me know how and code

  • @mohamedfazlan4074
    @mohamedfazlan4074 3 роки тому +1

    Thanks A lot. i Had a Small Issue ... How to Print Multiple Pages in 1 Pdf file? ( Mean Daily Entry as one PDF File or one Company invoices as one Pdf file)

  • @DerioMehra-Dr
    @DerioMehra-Dr 3 роки тому +1

    @Learn Google Spreadsheets I got error in line 2..... TypeError: cannot read property ‘namedValues’ of undefined ( line 2, file “code”)
    Need help

  • @anupriyamishra2037
    @anupriyamishra2037 4 роки тому +2

    Thanks for the tutorial. Please help me knowing that if a respondent is uploading any file that appears in spreadsheet as gdrive link then I want to show that image in the pdf also. What should I do for that. Please reply.

    • @iatulsinha
      @iatulsinha 3 роки тому

      I have the same question too.... Were you able to find a solution.. Thanks!

  • @Ankityadav-670
    @Ankityadav-670 2 роки тому +1

    TypeError: templateDoc.makeCopy is not a function.
    This is the error i am getting right now

    • @33FMC4
      @33FMC4 2 роки тому

      I got the same thing... did you find a fix?

    • @playdate7125
      @playdate7125 2 роки тому

      Make sure its indented under the create PDF function
      const newTempFile = templateDoc.makeCopy(tempFolder)

    • @incacleaningllc8021
      @incacleaningllc8021 2 роки тому

      @@playdate7125 I have the same error code. I tried indenting it. Still same error code. Any suggestions?

  • @19boss16
    @19boss16 Рік тому +1

    I need help . Do you have a function that triggers a new row in the Sheet. Iam working with Wordpress and Metforms. My Workflow is Form Submit => Zapier => Data in Google Sheets. So i cant set the trigger from the Google Form, I need a trigger for a new row.

  • @jonhollandWales
    @jonhollandWales 4 роки тому +3

    can you share the script?

  • @jonathanabrams5256
    @jonathanabrams5256 2 роки тому +1

    Nice video, but the removeFile() method is now deprecated. Is there another way to delete the tempFile? Also, it would be great if you can create a video just like this but using Google sheet as the template instead of a Google Doc file.

  • @violinesporlapaza.c.8037
    @violinesporlapaza.c.8037 4 роки тому +2

    anyone knows why am I getting this error? templateDoc.makeCopy is not a function

  • @calidadsed4713
    @calidadsed4713 Рік тому +1

    Excelente muchas gracias por su ayuda, que mi Dios lo bendiga por siempre. 🙏

  • @bndrjj
    @bndrjj 3 роки тому +1

    Awesome! u like to ask you if possible i can send the PDF file to whatsapp message Instead of using email .. That would be a great job if it were possible, i like to know how i can do that pleas.. if you can

  • @klarklucion5665
    @klarklucion5665 4 роки тому +2

    Sir, good day. Im new here. Ive read a question on how many emails i can send and you've answered 100 emails. May i know if that 100 emails is counted as 100 emails per day? Or for the entire duration? Thank you

  • @sadeeshanatomy4094
    @sadeeshanatomy4094 2 роки тому +1

    Nice video, am trying step by by step it was fine. but while trying from Response sheet to PDF ; "can not read namedValues" was the error msg. hw to rectify it.

  • @juniorwalewangko
    @juniorwalewangko 4 роки тому +2

    I've tried and this is awesome.
    For me this method has create a paperless system for my work.
    Awesome..!!!
    Definetely going to learn alot from this channel.
    Keep up the good work.👍🏻🙏🏻🙏🏻

  • @VFXMonkey1
    @VFXMonkey1 3 роки тому +1

    I would really appreciate it if you could show how to add an uploaded image from the form and add it to the PDF. Can't find the solution anywhere. Thank you

  • @allisonharvill936
    @allisonharvill936 4 роки тому +10

    I have no formal tech training but have been designated the tech person for a small non-profit and needed to do exactly what this tutorial does in a needed it done last week time frame. Thank you for making these videos. They are a lifesaver.

  • @jerisantillan
    @jerisantillan 3 роки тому +2

    Hi! Can you also teach how to include in the PDF an image uploaded in the form? I hope you could help me. Thank you so much for this by the way

    • @VFXMonkey1
      @VFXMonkey1 3 роки тому +1

      Yes please show this, I can find it anywhere

    • @obeidalotibi8420
      @obeidalotibi8420 3 роки тому

      if you want one image for you company or logo just add it to template if you want to add it to every one for employees just upload it to folder the read it and put the seam filed
      i hope this helpfull

  • @rexellmuyco3825
    @rexellmuyco3825 4 роки тому +2

    TypeError: Cannot read property 'namedValues' of undefined (line 3, file "Code")
    can anybody help me with my error?

    • @saakshichoudhary6327
      @saakshichoudhary6327 4 роки тому

      Yep

    • @aimanarshadhussain4768
      @aimanarshadhussain4768 4 роки тому

      Same :(

    • @rexellmuyco3825
      @rexellmuyco3825 4 роки тому

      ​ @Aiman Arshad Hussain Hi I already solved my problem. instead of using e.namedValues try using e.values[] instead. include e in your function parameter and dont run the function from the script as it will declare error. instead submit an entry from the form.

  • @DavidMohajerRahbari
    @DavidMohajerRahbari 4 місяці тому

    Have your code copied completely and am getting error
    TypeError: Cannot read properties of undefined (reading '0')
    at createPDF(Code:24:42)
    at afterFormSubmit(Code:3:3)

  • @rajiurrahman209
    @rajiurrahman209 3 роки тому +1

    Thanks for the video. Its very useful. But I am getting following error -
    TypeError: Cannot read property '0' of undefined
    at createPDF(Code:18:46)
    at afterFormSubmit(Code:3:3)

    • @netboy1102
      @netboy1102 2 роки тому

      you have to put the replacement in the same order as shown in Spreadsheet

  • @alimuzzamannayan3335
    @alimuzzamannayan3335 4 роки тому +1

    I am facing a problem. Inline 13, there is a function 'templateDoc.makeCopy'. But GAS IDE is saying there is no function named like this. What Can I do for this?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 роки тому

      Some went wrong in the line
      const templateDoc = blah blah

  • @mowlawn2882
    @mowlawn2882 2 роки тому +1

    Hi! I have no training and new at this so this was perfect! Thank You! I am just having trouble with an addition. I added a column to the sheet to calculate two columns and just want to show the total on the google doc. It looks like it won't extract since it's a calculated value. Can you please tell me what script I need to accomplish this? THANKS AGAIN :)

    • @richardpowell4667
      @richardpowell4667 2 роки тому

      I would try to pass the dependent cells values in your sheet into the script and use the script to calculate instead, then store that in a variable. I'd have thought it could pass calculated values....?

  • @diagnosticoporimageneshosp970
    @diagnosticoporimageneshosp970 4 роки тому +2

    The best channel to learn about google sheet
    Question:
    When a form is edited and resubmitted.
    The namedvalues ​​code only returns the modified values, there is a way to get all the values ​​of the current row and execute the PDF creation ?
    thx

    • @valentinpereira810
      @valentinpereira810 4 роки тому

      Hi, did you find a way to fix that ? I will be very grateful to you !

    • @diagnosticoporimageneshosp970
      @diagnosticoporimageneshosp970 4 роки тому

      @@valentinpereira810
      Yes,
      const ActiveSS = SpreadsheetApp.getActiveSpreadsheet();
      const ActiveSheet = ActiveSS.getActiveSheet();
      const ActiveRow = e.range.getRow();
      const Name = ActiveSheet.getRange('B'+ ActiveRow).getValue();
      const ContactEmail = ActiveSheet.getRange('C'+ActiveRow).getValue();

  • @7SkyMusic
    @7SkyMusic Рік тому

    Need App script please share source app script

  • @TheBricolore
    @TheBricolore 3 роки тому +1

    that's awesome! well i do have a question , how do i replaceText in the createPDF method when i have added a column with lets say a SUM ? when the form is submitted , it inserts a row in the sheet , so i made another sheet2 with the main columns and some extras , how do I use these extra column content with the replaceText?

  • @KarthikeyanP-p3e
    @KarthikeyanP-p3e 10 місяців тому

    Hi.
    I m getting below error. Kindly suggest what can do??
    TypeError: templateDoc.makeCopy is not a function

  • @andresalvarez7303
    @andresalvarez7303 4 роки тому +6

    PROBLEM: For some reason when using the removeFile() method, I kept getting a copy of the newTemplateFile in the root folder of my Drive. Everything else worked fine but this copy was just bothering me.
    SOLUTION: removeFile() method has been deprecated. Instead I simply used newTempFile.setTrashed(true). This method should work if anyone out there is having a similar issue

    • @SamirSELLAMI
      @SamirSELLAMI 4 роки тому

      Same problem, I will try your solution Thank U

  • @otaviopinhotavares4225
    @otaviopinhotavares4225 4 роки тому +1

    Amazing content! Can you please do a video with an uploading image? Exemple employers data and pic. I use gsuite files only work on my domain is that a problem to generate pdf with the pic?

  • @nasirahmad4324
    @nasirahmad4324 3 роки тому +1

    Really good video, I get an error, like: Exception: The parameters (DriveApp.File) don't match the method signature for DriveApp.File.makeCopy. (line 18, file
    How can I get the source code of this tutorial ?

    • @diditaxinl8099
      @diditaxinl8099 2 роки тому

      Drive app.getFileById();
      You should use .getFile methode

  • @MichaelDeLeon-kg7ht
    @MichaelDeLeon-kg7ht 5 місяців тому

    Hi, I created a script same as yours. I works and output the PDF. Im missing a code how to attach the image that I uploaded on the form and will be on the PDF. Can you help me please? Im not a coder. I just followed your instructions.

  • @dumdumknowhow
    @dumdumknowhow 4 роки тому +1

    Great Tutorial !!
    every thing working fine except send attachment .
    not sending the mail with pdf attachment.
    Sorry , this is the error .
    Exception: Invalid argument: attachments
    at sendEmail(Code:9:12)
    any one can help please . really appreciate

  • @flook-it1997
    @flook-it1997 4 роки тому +1

    thanks your chanel always awesome it would be great if you show me how to convert the data submitted to a PDF with image

  • @franztellocastillo7786
    @franztellocastillo7786 3 роки тому

    Error
    TypeError: templateDoc.makeCopy is not a function please help me

  • @AndeanFace
    @AndeanFace Рік тому +1

    Hi @ExcelGoogleSheets, I hope that you are doing very well! I made the script as you presented it, and was working very well, but at the momment it seems to have two problems, and maybe you have some information about them. 1) It seems that the "Class File" from Apps Script, the method "removeFile" used at the end of the script "tempFolder.removeFile(newTempFile); " isn't anymore supported, it appears crossed over in .gs . Could you recomend other method to do the same part of the script? And my second question, I receive this message of error: "TypeError: Cannot read properties of undefined (reading 'namedValues')" on the constant declaration, line 3: "const info = e.namedValues;" in the function declaration. Do you have the seame error message? Many thanks for your help!

  • @joaodoria2547
    @joaodoria2547 3 роки тому +1

    PROBLEMA: TypeError: Cannot read property 'First Name' of undefined (linha 19, arquivo "Código") FICA APARECENDO ESSA MENSAGEM TODA VEZ QUE TENTO RODAR O CÓDIGO, ALGUÉM PODE ME AJUDAR POR FAVOR. OBRIGADO!!
    PROBLEM: TypeError: Cannot read property 'First Name' of undefined (line 19, file "Code") THIS MESSAGE IS APPEARING EVERY TIME I TRY TO RUN THE CODE, SOMEONE CAN HELP ME PLEASE. thanks!!

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 роки тому +1

      You are supposed to submit the form instead of running the code.

  • @ciarajanay23
    @ciarajanay23 4 роки тому +3

    This is exactly what I needed! I am so proud of myself. I was able to follow along and using the Google App Script Reference you showed I was able to have it send as my alias and add an additional email to send the file to myself too! I will be doing more of your tutorials to learn more. And I have little to none Java Script knowledge.

  • @RoiUltraviolet
    @RoiUltraviolet 2 роки тому +1

    Excellent video, very good explanations with all the necessary details to understand simply and quickly. Congratulations and thank you for the remarkable quality of your knowledge sharing.

  • @satuiproject4561
    @satuiproject4561 3 роки тому +1

    How to send WhatsApp..thanks

    • @corbettdestination5256
      @corbettdestination5256 3 роки тому

      The same I am looking for. Let me know if you come across any solution

  • @juancavel
    @juancavel 5 місяців тому

    Do you have the script somewhere to copy and paste so it's faster to just make adaptions? Thank you in advance!

  • @luiscorado2868
    @luiscorado2868 4 роки тому +4

    Excellent like always!!!

  • @gabrielcambronero4338
    @gabrielcambronero4338 9 місяців тому

    Can anyone pleeeaseee help me to return in the body of the email a value from the spreasheet, such as the person name. I'm not programmer and I've tried do do it for myself but I failed everytieme I tried. Thank you.

  • @valentinpereira810
    @valentinpereira810 4 роки тому +1

    Thank you so much ! I have a question :
    When a form es edited and resubmitted. The namedvalues code only returns the modified values, there is a way to get all the values of the current row and execute the pdf creation? I Will be very grateful for your response !
    Thank you !

  • @nataliariabina3227
    @nataliariabina3227 4 роки тому +2

    Thank you , its wonderful !!! Question- when I make the same form "edit response " and submit , it will fill in PDF only edited fields, not edited- will insert as blank , how do I deal with that to make them to pick up old values and fill in new PDF ?

    • @valentinpereira810
      @valentinpereira810 4 роки тому

      Hello, did you find a way to fix that ? I will be very grateful to you !

  • @mohamed.montaser
    @mohamed.montaser 4 роки тому +1

    i have couple of questions:
    1) the " e.namedValues " will get all the data from the form?
    2) can i change the variable "e" to anything else or does it have to be "e"?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 роки тому +1

      I think it's event, not element, but it doesn't matter.

  • @simonashwood5081
    @simonashwood5081 3 роки тому

    can you help me? my app script always says that: TypeError: templateDoc.makeCopy is not a function

  • @ck3printing
    @ck3printing 4 роки тому +1

    TypeError: Cannot find function makeCopy in object Template for PDF. (line 13, file "Code")
    this what they say :< send help

    • @ck3printing
      @ck3printing 4 роки тому +2

      I already figured it out. :)

    • @olivervillamor5
      @olivervillamor5 4 роки тому +1

      @@ck3printing How did you fixed it?

    • @salimehaboob
      @salimehaboob 4 роки тому

      @@olivervillamor5 In the previous line Replace "getFolderById" to "getFileById". it worked for me.

  • @SiteInspections-l1s
    @SiteInspections-l1s 2 місяці тому

    please explain how to make photos visible in a google form pdf

  • @bocobox
    @bocobox 4 роки тому +2

    Addicted to your video. Just like daily routine. Thanks 😊

  • @noondonporn9710
    @noondonporn9710 3 роки тому +1

    Very nice but I want it normal speed

  • @emingunduz4690
    @emingunduz4690 2 роки тому +1

    You make me feel like I'm the best coder 😄 It worked so much for my work. I create order form. No more losting papers. Thank you

  • @demo7191
    @demo7191 3 роки тому +1

    Until 09:37 It work everything for me, but when you converting that script to reusable function are mysteries step for me, because I'm starting get a errors each time. How to add that event e correctly?

    • @Didikmuhamadakbar
      @Didikmuhamadakbar 3 роки тому

      me to

    • @demo7191
      @demo7191 3 роки тому +1

      @@Didikmuhamadakbar I found a solution. It shows a some error, but it works:
      function afterFormSubmit(e) {
      Logger.log(JSON.stringify(e));
      var formValues = e.namedValues;
      Logger.log(formValues);
      const info = e.namedValues;
      createPDF(info);

    • @Didikmuhamadakbar
      @Didikmuhamadakbar 3 роки тому

      @@demo7191 ok, i will try it,

  • @michaelwiegand2045
    @michaelwiegand2045 2 роки тому +1

    Hey there,
    Thanks for the video. I believe a couple of people are having the same issue similar to: "TypeError: Cannot read property 'namedValues' of undefined (line 2, file "Untitled")"
    And I have read through all the replies and tried all the troubleshooting. It worked initially then nothing changed and the trigger began to fail. On form submit I am still not getting the PDFs and trying to figure out how I ultimately fix the issue. I know you have had a lot of questions on this. but I am hoping you can just give one response and we can pin it. Code typed here:
    function afterFormSubmit(e) {
    const info = e.namedValues;
    createPDF(info);
    }
    function createPDF(info) {
    (folder references blocked for privacy)
    const newTempFile = TempDoc.makeCopy(tempFolder);
    const openDoc = DocumentApp.openById(newTempFile.getId());
    const body = openDoc.getBody();
    body.replaceText("{fn}", info['First Name'][0]);
    body.replaceText("{ln}", info['Last Name'][0]);
    body.replaceText("{addy}", info['Street Address'][0]);
    body.replaceText("{city}", info['City'][0]);
    body.replaceText("{state}", info['State'][0]);
    body.replaceText("{zip}", info['Zip Code'][0]);
    body.replaceText("{amnt}", info['Total amount of re-imbursement'][0]);
    body.replaceText("{for}", info['What is the re-imbursement for ? (be sure to include all details)'][0]);
    body.replaceText("{dtn}", info['Needed by what date?'][0]);
    body.replaceText("{staff}", info['Staff to approve reimbursement?'][0]);
    openDoc.saveAndClose();

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  2 роки тому

      Please submit the form and then check under Executions pane on the left for error messages.

    • @michaelwiegand2045
      @michaelwiegand2045 2 роки тому

      @@ExcelGoogleSheets here is some of the errors any insight would be great.
      TypeError: Cannot read property '0' of undefined
      at createPDF(Untitled 2:18:46)
      TypeError: Cannot read property 'First Name' of undefined
      at createPDF(Untitled 2:18:32)
      TypeError: Cannot read property 'namedValues' of undefined
      at afterFormSubmit(Untitled 2:2:18)

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  2 роки тому

      @@michaelwiegand2045 Are all these errors showing in one execution or separate executions?

    • @michaelwiegand2045
      @michaelwiegand2045 2 роки тому

      @@ExcelGoogleSheets seperate submission of the form and executions.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  2 роки тому

      between these 2 lines
      const body = openDoc.getBody();
      body.replaceText("{fn}", info['First Name'][0]);
      add
      console.log(info)

  • @smonaiz
    @smonaiz Рік тому

    Instead of emailing, cant we send this attachment on WhatsApp

  • @baljka17
    @baljka17 28 днів тому

    Man this is crazy and saved my life!

  • @09watsonjj
    @09watsonjj Рік тому +1

    Can you post the script here?

  • @UADC
    @UADC 10 місяців тому

    My email portion is not working...what should i do?

  • @VoiceArtistBD
    @VoiceArtistBD 3 роки тому

    but I couldn’t run, show this message...
    (DriveApp.File) don’t match the method signature for DriveApp.File.makeCopy. [ this line: const newTempFile = templateDoc.mskeCopy(tempFolder)] 😥😥

  • @cherrieang318
    @cherrieang318 3 роки тому +1

    Hi, how to fix this error?
    "TypeError: Cannot read property 'NamedValues' of undefined"

  • @KalkiUdyog
    @KalkiUdyog 11 місяців тому

    Hello how can we use the some thing in excel instead of google doc.

  • @gabrielcambronero4338
    @gabrielcambronero4338 9 місяців тому

    Hi!! I loved the video, I had some errors at first that I fixed with the info in the comments, but I'm still having one error:
    "Error
    Converting from application/vnd.google-apps.document to undefined is not supported.
    createPDF"
    Can anyone help please?

    • @gabrielcambronero4338
      @gabrielcambronero4338 9 місяців тому

      I just see my error: The line I was missing a ";" and a letter in between. Thank you again everybody

  • @puspitadf
    @puspitadf 3 роки тому +1

    Hi, thanks for the tutorial. However, I faced a problem during applying the script. It stated that "TypeError: Cannot read properti '0' of undefined (line 45, file "Code"). It refers to a body.replaceText part. Anyone can help, please?

    • @Didikmuhamadakbar
      @Didikmuhamadakbar 3 роки тому

      sama mbak

    • @diditaxinl8099
      @diditaxinl8099 2 роки тому

      Make sure you are not replacing the text which is not sent from the form.
      And you should run the script by using the trigger, don't run inside the editor, but run it by submitting the form

  • @cornevanzyl5880
    @cornevanzyl5880 4 роки тому +1

    You have unlocked Pandora's box of creativity for me. Thank for teaching us🙏

  • @davidclough6288
    @davidclough6288 3 роки тому +2

    This was AMAZING! It's the first time I've ever had no errors in my code. Thanks so much. I also appreciate how you didn't edit out your troubleshooting. That helped!

    • @daleramirez7438
      @daleramirez7438 3 роки тому

      Hi! Were you able to make it work? I tried and copied what he did in the video but I got notified with exception: invalid argument: attachments I don't how to troubleshoot it. I have no background in programming. Can you help me? 🙂

  • @Akash-ef4vx
    @Akash-ef4vx 4 роки тому +1

    Many Many thanks.its working..

  • @MauricioSedano-m8m
    @MauricioSedano-m8m 8 місяців тому

    Can you or anyone in this thread share the code, please?

  • @Bubbles-pfg
    @Bubbles-pfg Рік тому

    TypeError: Cannot read properties of undefined (reading 'namedValues')
    afterFormSubmit
    It didn't work in my end. I keep on having this issue. Can someone help me?

  • @jayksmusik2532
    @jayksmusik2532 Рік тому

    Receiving this error. Please assist.
    TypeError: Cannot read properties of undefined (reading '0')
    function afterFormSubmit(e) {
    const info = e.namedValues;
    createPDF(info);
    const entryRow = e.range.getRow();
    const ws = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1");
    ws.getRange(entryRow, 18).setValue(pdfFile.getUrl());
    ws.getRange(entryRow, 19).setValue(pdfFile.getName());
    sendEmail(e.namedValues['Email Address'][0],pdfFile);
    }
    function sendEmail(email,pdfFile){
    GmailApp.sendEmail(email, "Dear family, Attached is your guest list for the APHS Music Banquet.", {
    attachments: [pdfFile],
    name: 'APHS Music Department'
    });
    }
    function createPDF(info){
    const pdfFolder = DriveApp.getFolderById("*");
    const tempFolder = DriveApp.getFolderById("*");
    const templateDoc = DriveApp.getFileById("*");
    const newTempFile = templateDoc.makeCopy(tempFolder);
    const openDoc = DocumentApp.openById(newTempFile.getId());
    const body = openDoc.getBody();
    console.log(info);
    body.replaceText("{StudentFirstName}", info ['Student First Name'][0]);
    body.replaceText("{StudentLastName}", info ['Student Last Name'][0]);
    body.replaceText("{Grade}", info ['Grade'][0]);
    body.replaceText("{Ensembles}", info ['Ensembles'][0]);
    body.replaceText("{NumberofPeopleAttending", info ['Number of People Attending'][0]);
    body.replaceText("{Person1}", info ['Person 1'][0]);
    body.replaceText("{Person2}", info ['Person 2'][0]);
    body.replaceText("{Person3}", info ['Person 3'][0]);
    body.replaceText("{Person4}", info ['Person 4'][0]);
    body.replaceText("{Person5}", info ['Person 5'][0]);
    body.replaceText("{Person6}", info ['Person 6'][0]);
    body.replaceText("{Person7}", info ['Person 7'][0]);
    body.replaceText("{Person8}", info ['Person 8'][0]);
    body.replaceText("{Person9}", info ['Person 9'][0]);
    body.replaceText("{Person10", info ['Person 10'][0]);
    openDoc.saveAndClose();
    const blobPDF = newTempFile.getAs(MimeType.PDF);
    const pdfFile = pdfFolder.createFile(blobPDF).setName(info['Student First Name'][0]+ " " + info['Student Last Name'][0] + " | " + 'Music Banquet Guest List' + ' ' +
    currentYear ());
    tempFolder.removeFile(newTempFile);
    return pdfFile;
    }

  • @holcimsales3435
    @holcimsales3435 4 роки тому +1

    When I run the code , I get this error [20-10-14 06:40:04:855 PDT] TypeError: templateDoc.makeCopy is not a function
    at createPDF(Code:13:34), hope to get your help, thank you so much.

    • @jhone3241
      @jhone3241 4 роки тому

      Hi, even I'm getting same error "TypeError: templateDoc.makecopy is not a function (line 12, file "Code")"

    • @salimehaboob
      @salimehaboob 4 роки тому

      Same here. I received the same error TypeError: templateDoc.makeCopy is not a function (line 20, file "Code")

    • @stevenlee7524
      @stevenlee7524 4 роки тому

      I found this support.google.com/docs/thread/76410582?hl=en What did you end up doing to fix error?

    • @jhone3241
      @jhone3241 3 роки тому

      @@stevenlee7524 Couldn't do anything.

    • @stevenlee7524
      @stevenlee7524 3 роки тому

      @@jhone3241 I got it to work after looking at his other video ua-cam.com/video/r9uU_KwGgzQ/v-deo.html

  • @SMARTLAUNDRYLLC
    @SMARTLAUNDRYLLC 9 місяців тому

    Does this works by using it on a tablet?

  • @jfresh2054
    @jfresh2054 4 роки тому +1

    So I followed your exact steps and I get an error saying unexpected string on line 13. I also don't see the create pdf function, only my function. I don't know what to do. I've spent 3 hours looking at it and can't get it. Can someone please dear God help me out before I lose my mind? I can send you the script?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 роки тому

      share the code here

    • @jfresh2054
      @jfresh2054 4 роки тому

      @@ExcelGoogleSheets
      function myFunction() {
      }
      function createPDF() {
      const info = {
      'Location Name' : ['hello'],
      'Date' : ['hello'],
      'Property Address' : ['hello'],
      'Parcel ID' : ['hello']
      'Business City':['hello'],
      'PSD' : ['hello'],
      'Business Zip Code' : ['hello'],
      'Owner Name' : ['hello'],
      'Owner Phone Number' : ['hello'],
      'Owner Address If Different' : ['hello'],
      'Owner City If Different' : ['hello'],
      'Owner Zip Code If Different' : ['hello'],
      'Last Inspection Date' : ['hello'],
      'Does the STS discharge' : ['hello'],
      'If the STS discharges, what is the design flow' : ['hello'],
      'Does Sanitary sewer appear to be available' : ['hello'],
      'Septic Tank Condition' : ['hello'],
      'Aeration Tank Condition' : ['hello'],
      'Clarifier, Settling Tank Condition' : ['hello'],
      'FIlters Surface, Mounded, Subsurface, Condition' : ['hello'],
      'Leaching Component Tile, ET Field, Dry Bed, Leach Well, Other Condition' : ['hello'],
      'Chlorination Condition' : ['hello'],
      'Dechlorination Condition' : ['hello'],
      'Final Effluent Quality' : ['hello'],
      'Operation of STS' : ['hello'],
      'Maintenance of STS' : ['hello'],
      'The STS is not operating at expected efficiencies due to' : ['hello'],
      'Comments' : ['hello'],
      'Inspectors Name' : ['hello'],
      'Inspectors Signature' : ['hello'],
      'Business Email or Personal Email' : ['hello'],
      'Mail copy to the EPA' : ['hello'],
      'Nuisance Order Issued' : ['hello'],
      'Out of Business OOB' : ['hello'],
      'Connected to Sanitary Sewer' : ['hello']
      };

      const pdfFolder = DriveApp.getFolderById("1h0HHirKYHPW9OhCh38k0ILcodssBpl-o");
      const tempFolder = DriveApp.getFolderById("1KVdzxLUwg-z0xyOBREm1mrnzdinkD0K_");
      const templateDoc = DriveApp.getFolderById("1h-ig1aJbSpkaQ7l6el74BpcURB-h_y0lTA5RUWp7mXY");
      const newTempFile = templateDoc.makeCopy(tempFolder);
      const openDoc = DocumentApp.openById(newTempFile.getId());
      const body = openDoc.getBody();
      body.replaceText("{locationname}", info['Location Name'][0]);
      body.replaceText("{date}", info['Date'][0]);
      body.replaceText("{propertyaddress}", info['Property Address'][0]);
      body.replaceText("{parcelid}", info['Parcel ID'][0]);
      body.replaceText("{businesscity}", info['Business City'][0]);
      body.replaceText("{psd}", info['PSD'][0]);
      body.replaceText("{zip}", info['Business Zip Code'][0]);
      body.replaceText("{owner}", info['Owner Name'][0]);
      body.replaceText("{phonenumber}", info['Owner Phone Number'][0]);
      body.replaceText("{owneraddress}", info['Owner Address If Different'][0]);
      body.replaceText("{ownercity}", info['Owner City If Different'][0]);
      body.replaceText("{ownerzip}", info['Owner Zip Code If Different'][0]);
      body.replaceText("{lastinspection}", info['Last Inspection Date'][0]);
      body.replaceText("{discharge}", info['Does the STS discharge'][0]);
      body.replaceText("{designflow}", info['If the STS discharges, what is the design flow'][0]);
      body.replaceText("{sanitarysewer}", info['Does Sanitary sewer appear to be available'][0]);
      body.replaceText("{septictankcondition}", info['Septic Tank Condition'][0]);
      body.replaceText("{aerationtankcondition}", info['Aeration Tank Condition'][0]);
      body.replaceText("{clarifiercondition}", info['Clarifier, Settling Tank Condition'][0]);
      body.replaceText("{filtercondition}", info['FIlters Surface, Mounded, Subsurface, Condition'][0]);
      body.replaceText("{leachingcondition}", info['Leaching Component Tile, ET Field, Dry Bed, Leach Well, Other Condition'][0]);
      body.replaceText("{chlorinationcondition}", info['Chlorination Condition'][0]);
      body.replaceText("{dechlorinationcondition}", info['Dechlorination Condition'][0]);
      body.replaceText("{effluentqualitycondition}", info['Final Effluent Quality'][0]);
      body.replaceText("{operation}", info['Operation of STS'][0]);
      body.replaceText("{maintenance}", info['Maintenance of STS'][0]);
      body.replaceText("{operationefficiencies}", info['The STS is not operating at expected efficiencies due to'][0]);
      body.replaceText("{comments}", info['Comments'][0]);
      body.replaceText("{inspectorsname}", info['Inspectors Name'][0]);
      body.replaceText("{signature}", info['Inspectors Signature'][0]);
      body.replaceText("{businessemail}", info['Business Email or Personal Email'][0]);
      body.replaceText("{epa}", info['Mail copy to the EPA'][0]);
      body.replaceText("{orderissued}", info['Nuisance Order Issued'][0]);
      body.replaceText("{oob}", info['Out of Business OOB'][0]);
      body.replaceText("{sewer}", info['Connected to Sanitary Sewer'][0]);
      openDoc.saveAndClose();

      const blobPDF = newTempFile.getAs(MimeType.PDF);
      const pdfFile = pdfFolder.createFile(blobPDF).setName("My PDF");
      }
      I temporarily put "Hello" in the text that is being replaced.
      I am at the 10-15min mark on your video, however it keeps saying line "SyntaxError: Unexpected string (line 13, file "Code.gs". If I delete line 13 it still says it.
      I also don't have the Create PDF function popup like yours. It only says my function.
      I'm not sure if its the text I'm using or what, but I don't know what to do and am losing my mind.
      Please, if anyone can help me, I would greatly appreciate it.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 роки тому

      'Parcel ID' : ['hello'] comma missing
      'Parcel ID' : ['hello'],

    • @jfresh2054
      @jfresh2054 4 роки тому

      Learn Google Spreadsheets i got the script to finally work. The form is given access to 10 people and the documents are situated in a shared drive. I wasn't able to delete the temp docs due to it being a shared drive.
      Right now the pdf is emailing using my email regardless of who uses it. Is it possible to use the email of the person who submits the form? We have 10 field inspectors that use this but whenever they submit the form with the business email, it uses my email to send it. Can we use the email that submitted the form to send the email it?
      Not sure if that's possible.

  • @academiaeuropea5416
    @academiaeuropea5416 4 роки тому

    Ive been trying to set it up with slides instead of Doc. I dont know what am i doing wrong here but i always get stuck in that last line, any suggestions would be greatly appreciated.
    const pdfFolder = DriveApp.getFolderById("1EftYQW4Z_k_iY9jIkGwYKaGkskk1lVmI");
    const tempFolder = DriveApp.getFolderById("13DfHFLz2krBsjVvWE6oIUMocR4svDIwD");
    const templateSlides = DriveApp.getFileById("1US165doLj9P4SNANGnLOonvKaRz7mfyM");
    const newTempFile = templateSlides.makeCopy(tempFolder);
    const openSlides = SlidesApp.openById(newTempFile.getId( ));

  • @dolphinsgroupofschools2995
    @dolphinsgroupofschools2995 2 роки тому

    TypeError: templateDoc.makeCopy is not a function (line 33, file "pdf") please help me

    • @rizkaalina2186
      @rizkaalina2186 2 роки тому

      Same error here, have u figured it out?

  • @isaaccruzguido592
    @isaaccruzguido592 4 роки тому

    Anyone having not pdflink not being generated?
    Current Script:
    const info = e.namedValues;
    const pdfFile = createPDF(info);
    const entryRow = e.range.getrow();
    SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Responses").getRange(entryRow, 24).setValue(pdfFile.getUrl());

  • @common_wolf
    @common_wolf Рік тому +1

    cant send the email.

  • @brearddominique64400
    @brearddominique64400 Рік тому

    I copied your code exactly (with the id of my folders and file), but I have this error in the createPDF function, .:
    Error
    ReferenceError: newTempfile is not defined
    at this line: const openDoc = DocumentApp.openById(newTempfile.getId());
    and also in:
    tempFolder.removeFile(newTempFile);
    removeFile is deprecated . How can this be remedied?

  • @lasaventurasdevitoelgatoma3405
    @lasaventurasdevitoelgatoma3405 4 роки тому +1

    ur channel it is going to be big in no time!! congratulations 4 the good work n sharing!!

  • @amaraobilo
    @amaraobilo 3 роки тому

    Hi, I got this error trying to send this email
    Sep 15, 2021, 12:44:54 AM Error TypeError: Cannot read property 'Email Address' of undefined
    at afterFormSubmit(Code:10:26)
    please advise me. Thanks