Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

242
Views
Error de Sytax: Falta), pero no lo veo. Mis comillas tampoco parecen ser el problema.

He estado trabajando en el script de esta aplicación tratando de automatizar datos de una hoja de Google para crear eventos en Google Calendar. Intenté cambiar las comillas de simple a doble y viceversa. He comprobado mi () una y otra vez. No puedo ver lo que he hecho que me da el error de sintaxis. Si puedes verlo, por favor dímelo. Esto me está volviendo loco.

 function AutomateCalendarEvent() { let sheet = SpreadsheetApp.getActiveSheet(); let pqCalendar = CalendarApp.getCalendarById("zyxwvutsrqp"); let reservation = sheet.getRange("C2:E1105").getValues(); reservation.splice(0, 1); let rows = sheet.getDataRange().getValues(); rows.forEach(function (row, index) { if (index === 0) return; if (row[C3]) return; pqCalendar.createAllDayEvent("Last Name"C2:C, "Arrival Date"D2:D, "Departure Date"E2:E); }) }
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Echa un vistazo a mis comentarios

 function AutomateCalendarEvent() { let sheet = SpreadsheetApp.getActiveSheet(); let pqCalendar = CalendarApp.getCalendarById("zyxwvutsrqp"); let reservation = sheet.getRange("C2:E1105").getValues(); reservation.splice(0, 1); let rows = sheet.getDataRange().getValues(); rows.forEach(function (row, index) { if (index === 0) return; if (row[C3]) return;//C3 should be an index between 0 and 2 pqCalendar.createAllDayEvent("Last Name"C2:C, "Arrival Date"D2:D, "Departure Date"E2:E);//parameters should be a string followed by two dates //this is not the way insert parameters into above command. Ranges do not return values }) }
about 4 years ago · Juan Pablo Isaza Report

0

Suponiendo que sus datos son los siguientes

ingrese la descripción de la imagen aquí

Intente (para evitar duplicados, el ID del evento se almacena aquí en la columna AI fr instancia)

 function AutomateCalendarEvent() { let sheet = SpreadsheetApp.getActiveSheet(); let swCalendar = CalendarApp.getCalendarById("***********@gmail.com"); let rows = sheet.getRange(1, 1, sheet.getLastRow(), sheet.getLastColumn()).getValues(); rows.filter(row => row[2] != '').forEach(function (row, index) { if (index === 0) return; if (row[34] == '') { // AI try { sheet.getRange('AI' + (+index + 1)).setValue(swCalendar.createAllDayEvent(row[2], row[3], row[4]).getId()) } catch (e) { console.log(e) } } }) }

referencia

createAllDayEvent(título, fecha de inicio, fecha de finalización, {opciones})

ingrese la descripción de la imagen aquí

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!