How to get onFormSubmit to trigger automatically?

前端 未结 1 1857
轻奢々
轻奢々 2020-11-30 04:07

The \"fix\" (test_onformsubmit) code you gave, I have to manually run it every time there is new data in the spreadsheet. I was wanting it to automatically send the pdf to e

相关标签:
1条回答
  • 2020-11-30 05:03

    Read Understanding Triggers. This function is an Installable Trigger, so you need to set it up to run when a form is submitted. It's easy - I would have thought a Forms tutorial would have walked through it.

    In the Script Editor:

    1. Choose Edit > Current project's triggers. You see a panel with the message No triggers set up. Click here to add one now.
    2. Click the link.
    3. Under Run, select the function you want executed by the trigger. (That's onFormSubmit(), in this case.)
    4. Under Events, select From Spreadsheet.
    5. From the next drop-down list, select On form submit.
    6. Click Save.

    From this point on, the function will be triggered whenever a form is submitted to the spreadsheet.

    If you plan to share your script, each recipient will need to repeat these steps.


    As an aside, you should change the email setting in your script, so it will work for ANYONE.

    var email_address = Session.getActiveUser().getEmail();
    
    0 讨论(0)
提交回复
热议问题