getting responseID of latest form submission in google apps

前端 未结 3 662
旧时难觅i
旧时难觅i 2021-01-15 20:51

I have a google form. Every time it is submitted, the answers go into a google spreadsheet. I am trying to write an app script that triggers every time the form is submitted

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-15 21:48

    The solution is to remove:

    var form = FormApp.getActiveForm(); //this is WRONG
    

    and replace with:

    var form = FormApp.openByID(' ID here ')
    

    There is no "active form", because this script is being run in sheets, not forms.

提交回复
热议问题