r/GoogleAppsScript • u/bhatrahul • Jun 18 '25
Question Sync Google sheets with Google Calendar
Hey. I am trying out a pet project where in i am feeding the google sheets data from google forms . As a next step , i want that data to be displayed as an event in the calendar. Is it possible to do this? Also the sheets would be updated continuously and would need this to trigger the event creation for every new row. For example , i have the dates at each row which is a bday. I would like to prompt a message on one perticular calendar that its “name’s” bday every year. Thanks
7
Upvotes
3
u/CuteSocks7583 Jun 18 '25
Should be possible, I guess.
Google Calendar accepts data in CSV format.
3
u/mysportsact Jun 18 '25
It's very possible and I have something just like this for my business, it's not the fastest but the updates do work ...
However its implementation was a bit complex for me because of what I needed it to do.
Look up the calendar API
You will need a watch channel for calendar API push notifications however they will have to go thru Google cloud functions or some other receiver since GAS doesn't receive header information in their doPosts (finding this out cost me 1.5 days)
I highly suggest prompting an AI LLM with the GCF specified to avoid this (the AI tools can't quite guide you thru GAS as well as they can a more popular language)
In the end I created a pretty powerful tool for my business
I have some cool functionalities that you might want to implement:
Event syncing: let's say you're tracking birthdays, anniversaries, and some other significant event of various people and you want the description of each person to include descriptions of each of their events. You can make it so the script finds all the events relevant to that person and updates the descriptions for each one, triggered by the user description change in one of those events.
So in this scenario let's say we have Joe Smith Bday 1/1/25 Anniversary 2/2/25 Joined the company 3/3/25
In the bday event we can track what the company gave him as a bday gift or what dessert was bought for his celebration As soon as you update the bday event in 1/1/25 with "gift: red tie, dessert: key lime pie" It would show up in all of the events
Color change trigger: Whenever the user changes the color of an event let's say blue to green the script can trigger any sort of function
Let's say we want to PDF print and email something whenever this happens it's totally possible
Drive updating: Whenever I put a payment proof pdf or invoice in a clients drive file My script parses it and updates my Google sheet with my inventories and it also updates my calendar
Reporting: I made it so every Tuesday morning the script sends me an email with last week's summary of events (loads sent, payments received, total invoiced, total production, etc.) it also sends me a plan for the next 7 days of what shipments we need to prepare
It's a really cool tool id offer more in depth help but I'm a bit short on time these days (mostly because I'm still adding features to my project, including telegram bot interfacing to update things such as pictures and pdfs a bit easier on mobile) but if you get stuck I will try to help out where I can
1
u/ResponseIntel Jun 18 '25
Yes this is possible, I actually do this for my appointments.
1
u/gunitadhana Jun 18 '25
Yes, very much possible! Had a script that does the same thing but for meeting schedules. Very convenient I'd say.
Your trigger would mostly be an on change one, which activates when the sheet where the forms is linked gets a new response.
Your algorithm would just really be:
Good luck!
1
u/petered79 Jun 18 '25
a couple of weeks ago i asked Gemini to do a GAS page to let my students book a slot for exams. i ended up with a script that create the Google events in my calendar through sheets and a nice working booking page displaying the free slots and updating the taken ones in my calendar
1
u/Norman_Door Jun 18 '25 edited Jun 18 '25
Yes, you can use the Google Apps Script code below to get you started (I currently use this for another sheets-to-calendar syncing project).
Then, create a time-based trigger to run the
syncSheetToCalendar()function on a schedule and continually create & update events in your Google Calendar based on the data in your spreadsheet.The code below is used with the following spreadsheet columns.
Use an AI model like ChatGPT if you come across any issues. Good luck!
1
u/myke113 Jun 18 '25
You can do this with Google App Script. It's basically Java Script.
1
u/rayin_g Jun 18 '25
You can use Google App Scripts to automate this
1
u/phillippelevidad Sep 05 '25
Hey, not sure if this is useful, but I came across an add-on for google sheets the other day that lets you manage calendar events from sheets. You just open sheets, pick a calendar to import, and the events show up there. You can edit them and sync back to calendar. Here's the link if you want to try it out https://workspace.google.com/marketplace/app/calendar_to_sheets/200819935409 cheers