Error: Cannot call method "getEvents" of null



I’m trying to use the Holiday Tracking described here:

I keep getting the following error when hitting “RUN”:

Message details

TypeError: Cannot call method “getEvents” of null.

What am I doing wrong? How can I fix this?


Hi @iowasurrogate can you please share your spreadsheets with me (

I will take a look without revealing anything private.



Hi Bobby - I’ve shared the sheets with you. I’ll watch for your feedback, thanks!


@iowasurrogate don’t use https link to the calendar but instead follow the blog instructions to get the correct calendar ID and only paste the ID into the field.


Hi! Thanks for your help. I updated to the correct calendar ID, and I am no longer getting an error when running the script. But it’s also not doing what it’s supposed to. The request is not showing up in the calendar, nor is the Holiday Tracking tab populating correctly.

Any additional help you can provide would be appreciated!



You had some refs error which I fixed. Have you done any changes here manually that caused those refs errors?

Please retry now.




Those errors were there when I copied the sheet. Thanks for fixing.

Will you please advise - the features I’m using here, will I need to purchase a plan to utilize long term, or are these basic/free features?



@iowasurrogate much welcome! :slight_smile:

It’s free. :wink:



This still is not working for me. Now my data from the first spreadsheet (list of employees) is not filling into the holiday tracker spreadsheet.

The holiday tracker tab does not have information. Nor does the “SG Database.”

Hopefully I’m close to making this work?!

Thanks again for your help!


@iowasurrogate cannot confirm. Looking good to me:



I tested the template earlier and it worked well, but now I receive the same error. I have used the calendar ID as indicated in the setup instructions, but I had to manually change the available days on the “Holiday Tracking” tab, as not everyone in the company has the same allowance. Could this be causing it?

Note that despite the error, the “Holiday Tracking” tab is populated properly when I run the script, but the calendar isn’t updated.


Can you please show me a screenshot of that part?

Are you seeing any errors inside the cells?


Hi Bobby,

please see screenshot. There are no errors in the cells.


@Nadia_Anag I suggest at this stage, we take this into private message.

Can you share your sheets with me in a private message? Happy to take a closer look and provide a fix for you.



Dear @Nadia_Anag can you please retry clicking on below button?

Please share a screenshot of the error message you’re getting.




Hi Bobby,

I’ve run the script again and I didn’t get this error this time and the calendar was updated. However:

  1. The calendar event was created for the day before the one I approved. I assume that’s an issue with time zones, but I can’t find how to adjust this.
  2. The “Spent” row wasn’t updated in the “Holiday Tracking” tab.


Have you ensured that Spreadsheet, Apps Script and Calendar are all using the same time zone? They seem to not match:

Can you check again, please? Is it fixed now?


@Nadia_Anag were you able to adjust and align your time zones?


Hi - I see this questions was asked, but I’m not seeing the answer: how can I set the “available days” for employees so that it is imported from the HR Employee Database directly into the “Holiday Tracking” tab of the Holiday Tracker? As the other user, the available days for each employee is not uniform, and each time I add or remove an employee, I have to go back and manually change each person’s available days!

Thanks for your help!


@iowasurrogate something like this?