Error: Cannot call method "getEvents" of null

troubleshooting

#1

I’m trying to use the Holiday Tracking described here: https://blog.sheetgo.com/human-resources-templates/holiday-tracking/

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?


#2

Hi @iowasurrogate can you please share your spreadsheets with me (bobby@sheetgo.com)?

I will take a look without revealing anything private.

Thanks!


#3

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


#4

@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.


#5

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!

Thanks,
Sara


#6

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

Please retry now.

image


#7

Hi,

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?

Thanks!


#8

@iowasurrogate much welcome! :slight_smile:

It’s free. :wink:

Check https://www.sheetgo.com/pricing/


#9

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!


#10

@iowasurrogate cannot confirm. Looking good to me:

Link


#11

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.


#12

Can you please show me a screenshot of that part?

Are you seeing any errors inside the cells?


#13

Hi Bobby,

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


#14

@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.

Thanks!


#15

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

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

Thanks!

image


#16

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.

#17

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?


#18

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


#19

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!


#20

@iowasurrogate something like this?

https://docs.google.com/spreadsheets/d/1rSEwOoZnqcaKUYr9gl0P21SP2btH_og8K5cPu2BZ9Mo/edit#gid=1062819967