Home>
var calendarId = ""
var calender = CalendarApp.getCalendarById (calendarId)
  var date = new Date ();
  var checkEvent = CalendarApp.getEventsForDay (date);
  console.log (checkEvent)


I want the event registered on the runtime date to be stored as an array in the variable checkEvent.
If i check the log after execution, it will be displayed as follows.

[]

Does this mean that an empty array is displayed in the log?
I understand that the result of getEventsForDay is stored in the variable checkEvent. Is this different?

It seems strange that nothing is displayed because the events are well registered in the calendar.
It's also not a calendarId typo.

Please tell me what is wrong.

  • Answer # 1

    Was self resolved.

    var calendarId = ""
    var calender = CalendarApp.getCalendarById (calendarId)
      var date = new Date ();
      var checkEvent = CalendarApp.getCalendarById (calendarId) .getEventsForDay (date);
      console.log (checkEvent)


    If so, it worked.

Related articles