Search code examples
google-apps-scriptgoogle-sheetstriggersgoogle-forms

onFormSubmit(e) returning NULL e value


I am trying to work with data submitted by users via Google Forms. My trigger is tied to the spreadsheet on Form Submit, but when I use the following code, I get "e" returned with a NULL value and I can't do anything with it. I am submitting it through the forms and not just running a script. My spreadsheet is updating fine, but I can do anything with the values I'm getting.

    function getTickets(e) {
      var values = e.namedValues;
      Logger.log(e);
      Logger.log(values);
    }

The exact error I get is:

[20-03-10 21:48:22:765 EDT] TypeError: Cannot read property 'namedValues' of undefined
at getTickets(Tickets:2:18)


Solution

  • The problem was reported that user was getting a nulll for event object parameter values. I suggested trying to switch back to legacy ES5 because it’s easy to do and it seems to fix many difficult to understand problems.