Welcome to this tutorial where you’ll learn how to import Google Calendar Data into Google Sheets. Are you looking for a way to only export Google Calendar Data? Check out our other blog post on how to do that.
Before I automated my Google Calendar data, I used to manually export my calendar data as .zip files. In there were ICS files, which contained my calendar data. After unzipping, some converting was needed, before I could import them to Google Sheets. This is as cumbersome as it sounds. Not only does this process takes a ton of time, but it is also dreadful work. Luckily a friend of mine came across a script that automates this. With this Apps Script, you are able to export your data as often as you want.
If you have ever used Google Sheets Scripts before, this one is super easy. The script has already been written for you. Therefore, the only thing that you need to do is making a copy of the existing script and change the parameters, this will take 15 minutes of your time. This is how you do it!
Import Google Calendar Data to Google Sheets
Make a copy of our template
- Go to this Google Spreadsheet.
- Make a copy of the Google Spreadsheet. You can find this function under File. Give your copy a new name and save it somewhere where you can easily find it. Hit OK!
- Once you have your own copy, open the newly created spreadsheet.
Change the parameters in the Apps script
- Go to your Script Editor. You can find this under Tools. A new tab will open in your browser. This is the Script Editor. In the script editor, you are able to make applications that integrate with Gsuite. Both Google Calendar and Google Sheets are part of Gsuite.
- The Google Script Editor will open, once in the Script Editor we need to change 2 things.
- Firstly, we will change the e-mail address. In line 4 of the script, you will find a variable containing a string. Replace the ‘email@example.com’ with your own email address, for instance: “firstname.lastname@example.org”.
- After that, the next thing that you need to change is the two dates in line 9. All events between these two dates will be imported. In the example code, this will be every event between October first and December 31th. In the gif below I change the settings to get events for the whole of 2021.
- If you have changed the parameters, you can save the script. You can do this by hitting the save icon, ctrl + s or cmd +s.
Authorize the Google Sheets Script
- When you have saved your script, you can run it. Hit ‘Run’. After a few seconds, a pop-up will appear, asking for authorization.
- Click on ‘Review Permissions’.
- Choose an account that you want to give permission
- It could happen that you get a new window containing the message: ‘Google hasn’t verified this app.’. This is very well the case, this script hasn’t been verified by Google. However, since you have created this script yourself it’s perfectly safe.
- To continue, click on Advanced in the left corner
- Click ‘Go to Project Name (Unsafe)’, your own project name will be displayed here.
- You now need to link your Google Account to this script in order to get the data of your Google Calendar.
- Click Allow and the script should start running, this will take a bit.
- At the bottom of your screen, an execution log will appear. In this log, it will state when the execution has started and when it completes. When complete, your data should be in the Google Sheet.
- At last, go back to your Google Sheet to see your data. If everything went well, you now see your calendar as a dataset!
Thanks for following this tutorial!
Finally, I hope that everything about this tutorial was clear and that you have successfully exported your data out of Google Calendar into Google Sheets. To finish, if you have any questions or feedback, feel free to leave a comment in the section below. By leaving a comment. Cheers!