Google script project trigger not running?

后端 未结 2 1935
隐瞒了意图╮
隐瞒了意图╮ 2020-12-12 00:15

I\'m pretty new to Javascript and have been working on this script to take the most recent entry in a spreadsheet (created from a Google form), match the users email address

2条回答
  •  天命终不由人
    2020-12-12 00:55

    You are aware that there are 2 types of trigger simple and installable but I think you are a little confused as to what they actually mean/ do. I'll try to explain the key points from documentation here.

    A simple trigger is used by simply naming the function with the trigger name. For example, with Sheets / Forms, the trigger onFormSubmit(e) is fired when the user submits a form. The parameter e contains all the information relating to the submission, you should look into this as it's much more reliable than your current method of getting the submitted information. See here: 'e' parameter

    Simple triggers are limited in their functionality since the script doesn't have to be authorised for the trigger to fire. A simple trigger cannot access other files, send emails or perform any action that requires authorisation. See here

    An installed trigger is one that is either manually set up by the user or a script. Installed triggers have a lot more functionality but they still have some restrictions. See here

    An installed trigger can call any named function and e parameter works in the same way as it does with simple triggers.

    From your code above your installed trigger should look like this.

    When you click save you should be asked for authorisation, if you are not asked, click the debug/ run button to authorise the script.

    If it still doesn't work check the execution transcript in view -> execution transcript, the last line will indicate the error.

提交回复
热议问题