Guides › Duplicate events
Why your Sheets → Calendar script creates duplicate events
You ran your Apps Script again and now every event is in Google Calendar twice. Here's why, and how to fix it for good.
Cause 1: the script always calls createEvent
CalendarApp.createEvent() always makes a new event. It doesn't know the row was synced before. Fix: store each event's ID next to its row (event.getId()), and on later runs call cal.getEventById(id) and update that event instead. Our free script does exactly this.
Cause 2: the script crashed halfway, then you ran it again
If the script saves IDs only at the end, a run that stops after 6 minutes (Apps Script's limit) or on an error loses them, and the rerun creates those events again. Fix: write each ID into the sheet right after creating its event.
Cause 3: two runs at the same time
A double click, two people running it, or a trigger firing during a manual run: both runs see an empty ID cell and both create the event. Fix: wrap the work in LockService.getDocumentLock() so only one run happens at a time.
Cause 4: an edit trigger that re-syncs everything
An installable "on edit" trigger that loops over every row runs on every keystroke-sized edit. Combined with cause 1, each edit duplicates the whole sheet. (A simple onEdit function can't create events at all, because it isn't allowed to use services that need permission.) Fix: sync on a menu click or a time-driven trigger, and use stored IDs.
Cause 5: copied rows carry the old ID
Copy a row to make a new shift and you copy its Event ID too. Now two rows fight over one event, and the calendar shows only the last one written. Fix: clear the ID cell on copied rows.
Cleaning up the duplicates you already have
- If the script wrote to its own calendar, the fastest fix is deleting that calendar and syncing again with IDs in place.
- Otherwise search the event title in Google Calendar and delete the extra copies.
Launching on the Google Workspace Marketplace in November 2026.