Apps Script: Create Calendar Events from Google Sheet Data

Wish your Google Sheet could automatically add events to your Google Calendar? Good news — it can! With Google Apps Script, you can turn rows of data into calendar events in just a few clicks. This is a powerful way to stay organized, especially if you’re managing meetings, appointments, project deadlines, or reminders through spreadsheets.

Whether you’re planning a team schedule, class timetable, or booking system, this automation keeps your calendar in sync without any manual copy-paste. Let’s walk through how to make it happen — even if you’re brand new to Apps Script!

Apps Script - Create Calendar Events from Google Sheet Data

What Is Google Apps Script?

Google Apps Script is a simple coding language (based on JavaScript) that lets you automate tasks inside Google Workspace — like Sheets, Docs, Gmail, and Calendar. In this tutorial, we’ll use Apps Script to automatically create calendar events using info from your Google Sheet.

Real-Life Scenario: Team Meeting Scheduler

Imagine you have a spreadsheet to track team meetings. Instead of manually adding each one to your calendar, you want the sheet to handle that for you. Here’s what your sheet might look like:

Sample Sheet Layout

Event Title Description Date Start Time End Time Location Added?
Team Sync Weekly check-in 2025-04-22 10:00 11:00 Meeting Room A No

Once you run the script, this row will create a Google Calendar event, and the “Added?” column will update to “Yes”.

Step-by-Step: Create Events from Google Sheets

  1. Open your Google Sheet and click Extensions > Apps Script.
  2. Delete any placeholder code and paste the following:
    
    function createCalendarEvents() {
      var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Events");
      var calendar = CalendarApp.getDefaultCalendar();
      var data = sheet.getDataRange().getValues();
      
      for (var i = 1; i < data.length; i++) {
        var row = data[i];
        var title = row[0];
        var description = row[1];
        var date = new Date(row[2]);
        var startTime = new Date(date);
        var endTime = new Date(date);
        var start = row[3].split(":");
        var end = row[4].split(":");
        startTime.setHours(start[0], start[1]);
        endTime.setHours(end[0], end[1]);
        var location = row[5];
        var added = row[6];
        
        if (added !== "Yes") {
          calendar.createEvent(title, startTime, endTime, {
            description: description,
            location: location
          });
          sheet.getRange(i + 1, 7).setValue("Yes");
        }
      }
    }
        
  3. Click the disk icon to save your project.
  4. Run the function once by clicking the ▶️ Run button (you may be asked to authorize the script).
  5. Watch the magic — your calendar will populate with events!

Key Benefits

  • Time-Saving: No more manual entry in Google Calendar.
  • Error-Free: Avoid typos and scheduling mistakes.
  • Scalable: Great for managing dozens or hundreds of events.

Pro Tips

  • Change CalendarApp.getDefaultCalendar() to CalendarApp.getCalendarById("your_calendar_id") to use a shared/team calendar.
  • Use sheet.getLastRow() to improve performance on large sheets.
  • Add a custom trigger to run this function daily or hourly.

Setting Up a Time-Based Trigger (Optional)

  1. In the Apps Script editor, click the clock icon ⏰ (Triggers).
  2. Click “+ Add Trigger”.
  3. Choose createCalendarEvents function.
  4. Select event type: Time-driven > Day timer > Midnight to 1am.
  5. Click Save.

This makes the script check your sheet daily and add new events automatically.

Quick Cheat Sheet

Term What It Means
Apps Script A tool to automate tasks in Google Workspace using JavaScript
CalendarApp Lets you create or edit Google Calendar events through code
createEvent() Adds an event with title, time, and optional details
onEdit() A trigger that runs when a sheet cell is changed manually (not used here, but handy!)

Creating Google Calendar events from Google Sheets is easier than it sounds. With just a bit of code, you can turn your spreadsheet into an automated event planner that saves time and reduces stress. Whether you’re organizing meetings, classes, or reminders — this setup gives your sheet superpowers.

Give it a try, and let your calendar keep up with your spreadsheet!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top