Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

126
Vistas
Apps Script Google Calendar API Integration String Class Error

I'm super new to JavaScript, am a marketing executive by trade, but need to create a Google Calendar view from a Google Sheet for our content calendar for myself. After following some YT tutorials and finally running the code itself, I received the following error message:

Exception: The parameters (String,String,(class)) don't match the method signature for CalendarApp.Calendar.createAllDayEvent.

The following is my code:

function addEvents(){
  var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var lr = ss.getLastRow();
  var cal = CalendarApp.getCalendarById("CalendarID");

  var data = ss.getRange("A3:C" + lr).getValues();

  for(var i = 0; i<data.length; i++){
    cal.createAllDayEvent(data[i][1], data[i][0], {description: data[i][2]});

  }

}

In my Google Spreadsheet, the order of the data is as follows (data only appears in A3:C3 and downwards to the bottom rows): column A: Date, B: Event Title, C: Description

Hope to get some help, would appreciate it :'D

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

I just tested your script and I noticed that after changing the date column information to String format it returned the specified error. I changed it back to Date format in the Sheet and it created the events as expected.

Make sure your dates are in the proper format in your Sheet and then try again. After that it should run just fine.

For reference the expected parameters type are specified here

about 4 years ago · Juan Pablo Isaza Denunciar

0

You could also try:

cal.createAllDayEvent(new Date(data[i][1]), new Date(data[i][0]), {description: data[i][2]});

about 4 years ago · Juan Pablo Isaza Denunciar

0

was able to solve the problem, turns out it was just linked to the wrong spreadsheet hence the issue! The code itself was working already. Appreciate the help!

However, there is something else I just noticed I may need some help with. I would also like for it to be able to update any edits I made to the spreadsheet but also not duplicate the events that were already made from the first run. I know it's got something to do with the GetID string but I'm not too sure how to go about it since this is my first time coding, would really appreciate it anyone can aid with that too? :'D

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda