0

I'm new to this script knowledge.. i'm just create new script to create calendar events in google calendar. but events always keep duplicate. sorry for my bad english..

function createCalendarEvent(){
  var commCalendar = CalendarApp.getCalendarById("c_b88ce6305855780cdbce6222ac7156d57947d27ef80790a2c1536b7ffc40fd52@group.calendar.google.com");
  var sheet = SpreadsheetApp.getActiveSheet();

  var schedule = sheet.getDataRange().getValues();
  schedule.splice(0, 1)

  schedule.forEach(function(event){
    console.log(event[7], event[8], event[10]);
    commCalendar.createEvent(event[7], event[8], event[10]);
  });
}

Please help me fix it. prevent it from duplicating..

  • In your situation, as a simple method, how about checking whether the event has already been created using a column? I thought that this recent thread might be useful. https://stackoverflow.com/a/74310527 – Tanaike Nov 17 '22 at 00:37

0 Answers0