Google Calendar Google Apps Script coding project

Google Apps Script Project with Google Calendar

Objective

Extract events on your calendar to make a list on a spreadsheet.

Difficulty: Easy

This is NOT coding from scratch. This is a getting started with Google Apps Script project. The template has the code.

Template

alicekeeler.com/calscript

Steps

  1. Make a copy of the template by going to alicekeeler.com/calscript and making a copy when prompted.
  2. Use the Tools menu and choose “Script editor.”
    Tools menu script editor
  3. Don’t freak out. This is some Google Apps Script code (based on JavaScript). For this coding project, you are only going to EDIT the code, not write code. So an easy place to start. Take a look and see if you can make any sense out of it. Look for patterns.
  4. In JavaScript you can insert comments into the code (in other words, not code) by typing two slashes. //
    I have inserted some comments (think post it notes) into the code to help explain what the code is doing.
    Read the comments (they are in yellow).
    Insert Comment into Google Apps Script
  5. First thing you need is the calendar ID from the Google Calendar that you want to extract a list of the calendar events from. This is the trickiest part of this project. Go to calendar.google.com and locate your list of calendars on the left hand side. Notice if you hover over a calendar that there is a tiny triangle. Click on that and choose “Calendar settings.”
    Calendar settings
  6.  Locate the “Calendar Address.” If this is your default calendar it is just your email, so easy! If it is an additional calendar it is funky looking (classroom116209001132756006011@group.calendar.google.com.) Copy this.
    Grab the calendar ID
  7. Back in the code! You will want to delete the words PUT CALENDAR ID HERE FROM CALENDAR SETTINGS
    But leave the single quotes! Those are important.
  8. Paste the Calendar ID in place of the text. Make sure there are single quotes around it.
    Paste the Calendar ID
  9. Change the dates. Look at your calendar, put some events on the calendar or look for a date range that has some events. This project is not that cool if you do not have any events to extract 🙂
    Look at line 9 in the code and change the start date. Notice the pattern for how the dates are written.
    Also, notice that the dates are in between single quotations.
    Change the dates
  10. Do not change any more code. Look at the rest of the code, but do not touch it.
  11. Save the code. Press the disk icon in the toolbar. (For those of you under the age of 20, it’s a square with a circle on it.)
  12. Run the code by pressing the sideways triangle icon in the toolbar.
    Run
  13. Toggle back to the spreadsheet. The code should insert a sheet and provide you your calendar details.

 

Digiprove sealCopyright secured by Digiprove © 2017