Re: [Apps-Script] Add or Update Google Calendar Event from Google Sheet with App Script

486 views
Skip to first unread message
Message has been deleted

Ed Sambuco

unread,
Aug 6, 2022, 11:03:45 AM8/6/22
to google-apps-sc...@googlegroups.com
Well .. you could write a script that draws data from spreadsheet cells and then search for it in the calendar:

var calendar = CalendarApp.getCalendarById(calendarId);

var options = {search: 'Test'};
var allEvents = calendar.getEvents(startDate, endDate, options);

Then check for allEvents.length as 0 or 1, and go into add/update calendar events from there.  Granted, the search options are basically limited to full text.

On Fri, Aug 5, 2022 at 8:49 AM Sam Offsey <sam.o...@gmail.com> wrote:

I have a google sheet where each row represents an event I would like on my google calendar. Is it possible to create an App Script that updates an existing event's details if the title and time match, but creates a new event if no match is found? Are there any example codes of how to do this? Thanks


--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/54838da8-5d9c-4e91-ad84-d4aaf0f7a7d2n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages