Read and List Calendar Events

CalendarApp lets you retrieve events by date range, search by keyword, and read all properties of an event — title, time, attendees, description, status, and more. This is useful for syncing calendar data into a spreadsheet, auditing upcoming meetings, or building a schedule dashboard.

Getting Events for a Date Range

function getThisWeeksEvents() { var calendar = CalendarApp.getDefaultCalendar(); var start = new Date(); var end = new Date(); end.setDate(end.getDate() + 7); var events = calendar.getEvents(start, end); events.forEach(function(event) { Logger.log( event.getTitle() + " | " + event.getStartTime() + " – " + event.getEndTime() ); }); }

Searching Events by Keyword

function findFollowUpCalls() { var calendar = CalendarApp.getDefaultCalendar(); var start = new Date(); var end = new Date(); end.setDate(end.getDate() + 30); var events = calendar.getEvents(start, end, { search: "Follow-up Call" }); events.forEach(function(event) { Logger.log(event.getTitle() + " on " + event.getStartTime()); }); }

Writing Events to a Google Sheet

This example pulls all upcoming sales events and logs them into a Calendar Log sheet:

function exportEventsToSheet() { var calendar = CalendarApp.getDefaultCalendar(); var start = new Date(); var end = new Date(); end.setMonth(end.getMonth() + 1); // Next 30 days var events = calendar.getEvents(start, end); var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName("Calendar Log") || ss.insertSheet("Calendar Log"); sheet.clearContents(); sheet.appendRow(["Title", "Start", "End", "Location", "Description"]); events.forEach(function(event) { sheet.appendRow([ event.getTitle(), event.getStartTime(), event.getEndTime(), event.getLocation() || "", event.getDescription() || "" ]); }); Logger.log("Calendar events exported: " + events.length); }

Checking Whether a Customer Has a Scheduled Call

This example cross-references the Sales Tracker with the calendar to flag which In Progress customers have a follow-up call already scheduled:

function auditFollowUpCoverage() { var sheet = SpreadsheetApp .getActiveSpreadsheet() .getSheetByName("Sales Tracker"); var data = sheet.getRange(2, 1, sheet.getLastRow() - 1, 7).getValues(); // Columns: [Customer Name, Email, Product, Amount, Region, Sales Rep, Status] var calendar = CalendarApp.getDefaultCalendar(); var now = new Date(); var nextMonth = new Date(); nextMonth.setMonth(nextMonth.getMonth() + 1); var upcomingTitles = calendar.getEvents(now, nextMonth).map(function(e) { return e.getTitle(); }); data.forEach(function(row) { var customerName = row[0]; var status = row[6]; if (status !== "In Progress") return; var hasEvent = upcomingTitles.some(function(title) { return title.indexOf(customerName) !== -1; }); Logger.log(customerName + ": " + (hasEvent ? "Follow-up scheduled" : "NO follow-up found")); }); }

With the sample data, Mark Chen is checked — if a follow-up event exists with his name in the title, it logs Follow-up scheduled; otherwise it flags the gap.

Reading Attendee Status

function checkAttendeeResponses() { var calendar = CalendarApp.getDefaultCalendar(); var now = new Date(); var nextWeek = new Date(now.getTime() + 7 * 24 * 60 * 60 * 1000); var events = calendar.getEvents(now, nextWeek, { search: "Onboarding" }); events.forEach(function(event) { Logger.log("Event: " + event.getTitle()); event.getGuestList().forEach(function(guest) { Logger.log(" " + guest.getEmail() + " – " + guest.getGuestStatus()); }); }); }

Guest statuses: ACCEPTED, DECLINED, MAYBE, INVITED (pending response).