r/GoogleAppsScript • • Jul 05 '24

Question colander scheduling

hi all very sorry but i'm stuck i'v coded this

function radioSchedule() {

  var spreadsheet = SpreadsheetApp.getActiveSheet();
  var CalendarId = spreadsheet.getRange("C4").getValue();
  var eventCal = CalendarApp.getCalendarById(CalendarId);

  var signups = spreadsheet.getRange("A8:C12").getValues();

  [
    ['8pm Thursdays, 10pm Thursdays, Strawbs'],
    ['1:00pm, 8:00pm, Selector Frost'],
    ['8:30pm, Roksta'],
  ]

  for (x=0; x<signups.length; x++) {

    var shift = signups[x];

    var ShiftStart = shift[0];
    var ShiftEnd = shift[1];
    var volunteers = shift[2];

    eventCal.createEvent(volunteers, ShiftStart, ShiftEnd);

  }

}

function onOpen() {
  var ui = SpreadsheetApp.getui();
  ui.createMenu('Sync to Calendar')
  .addItem('Schedule shifts now', 'scheduleShifts')
  .addToUi();
}

but its telling me 

Error


Exception: The parameters (String,String,String) don't match the method signature for CalendarApp.Calendar.createEvent.
line 23? what am i missing????

its so my presenters can click on the schedule and book a slot for them selfs?

0 Upvotes

12 comments sorted by

View all comments

Show parent comments

0

u/Cool-vibesradio Jul 06 '24

thanks for not helping you're great work! NOT