Troubleshooting of google apps script
Jump to navigation
Jump to search
Troubleshooting of google apps script about CalendarApp
Fix: TypeError: Cannot read property 'createEvent' of null[edit]
Code
let cal = CalendarApp.getCalendarById(calendar_id); let event = cal.createEvent(title, start_time, end_time);
Error message
TypeError: Cannot read property 'createEvent' of null setUpCalendar @ 程式碼.gs:42
Solution: Verify the cal variable is not null.
Code
let cal = CalendarApp.getCalendarById(calendar_id); Logger.log('The calendar is named "%s".', cal.getName());
Fix: Exception: Action not allowed[edit]
Error message
Exception: Action not allowed setUpCalendar @ 程式碼.gs:45
Code
let cal = CalendarApp.getCalendarById(calendar_id); let event = cal.createEvent(title, start_time, end_time, options);
Solution: Verify the gmail account running apps script was allowed to write the google calendar
Fix: TypeError: cal.createEvent(...).createEventFromDescription is not a function[edit]
Error message
TypeError: cal.createEvent(...).createEventFromDescription is not a function setUpCalendar @ 程式碼.gs:45
Root cause: use the wrong function
Code
let options = {description: description, guests: email_of_guest}; let event = cal.createEvent(title, start_time, end_time, options);
Further reading[edit]
- Troubleshooting | Apps Script | Google Developers
- Class CalendarApp | Apps Script | Google Developers
- 一份考卷不夠你可以出兩份!用 google apps script 出線上考題 :: 2021 iThome 鐵人賽
Troubleshooting of ...
- PHP, cUrl, Python, selenium, HTTP status code errors
- Database: SQL syntax debug, MySQL errors, MySQLTuner errors or PostgreSQL errors
- HTML/Javascript: Troubleshooting of javascript, XPath
- Software: Mediawiki, Docker, FTP problems, online conference software
- Test connectivity for the web service, Web Ping, Network problem, Web user behavior, Web scrape troubleshooting
Template