pratik0809 / GSheetsToMailchimp

A script written for Google Sheets that allows you to send edits on your spreadsheet to Mailchimp merge fields instantly.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot read property "source" (line 59, file "Code")

andrewvink opened this issue · comments

Thank you for posting the script - it's exactly what we were looking for!

When adding the mailchimp details and trying to run the script I get:

ERR: TypeError: Cannot read property "source" from undefined. (line 59, file "Code")

On this line:
var activeSheet = e.source.getActiveSheet();

Am I missing something?

Many thanks!

Hey Andrew, were you clicking the "Run" button on google apps script? That would cause an error because there is no onEdit range. This script is triggered via an edit. If you want to test the script, there's a way to debug the trigger at the bottom of the script by selecting the 'test_onEdit' function. You could also edit any cell in the appropriate column (in my case, it was the 'Points' column line 61) and that should trigger the function to run.