Fetch and Insert Google Calendar Events Into Spreadsheet
Fetch and Insert Google Calendar Events Into Spreadsheet
1. Open Google Sheets and select or create the spreadsheet where you wish to import
your calendar events.
2. Click on "Extensions" > "Apps Script" in the Google Sheets menu to open the Apps
Script editor.
3. Copy the following script into the Apps Script editor:
/**
* Function to fetch calendar events and insert into active spreadsheet.
*/
function fetchAndInsertCalendarEvents() {
try {
const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
const headers = ['Date of the event', 'Day of the week of the event', 'Title', 'Start Time of the
Events', 'End Time of the Events', 'Location of the Event'];
sheet.getRange('A1:F1').setValues([headers]);
1. To run the script, save your changes in the Apps Script editor and then click on the
play/run button.
2. You may need to authorize the script to access your Google Calendar and Google
Spreadsheet. Follow the prompts to do this.
3. Once the script has run successfully, you should see your Google Calendar events
populated into your spreadsheet.