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

117
Views
Cómo obtener ID de archivo para enviar correos desde GoogleSheets/Script

Soy nuevo en la codificación y tengo problemas con un código en el que sigo recibiendo "Error Syntaxis: Missing) después del argumento

Este es mi código actual:

 function myFunction(){ const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet('Form Responses 1'); const url = sheet.getRange().getValues(); url.forEach(function(row,index){ if (index === 0) return; if (row[19]) return; const idFile = url.match(/[-w]{25,}/); const file = DriveApp.getFileById(idFile) const blob = file.getAs(MimeType.PDF) var message = 'Thanks for your interest this will be the first step' var mail = row[2] var team = row[8] GmailApp.sendEmail(mail,team,"Subject",message,{attachments: [blob]})

Este es mi segundo script, el primero que construí para crear PDF para cada nueva entrada de formulario de Google y en la columna 19 está escrito el enlace PDF. La idea es que después de que se crea el enlace PDF, toma la identificación del archivo y luego lo envía automáticamente a la persona que llenó el formulario con CC a mi equipo si no se crea un enlace, entonces no debería enviarlo.

Pero he investigado y sinceramente no se mucho para identificar mi error, espero que alguien me pueda ayudar se lo agradecería. ¡O no dando la respuesta, pero se agradecería ayuda en cualquier forma!

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Falta el paréntesis después de la función de flecha, consulte el comentario a continuación.

 function myFunction() { const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet('Form Responses 1'); const url = sheet.getRange().getValues(); url.forEach(function (row, index) { if (index === 0) return; if (row[19]) return; const idFile = url.match(/[-w]{25,}/); const file = DriveApp.getFileById(idFile) const blob = file.getAs(MimeType.PDF) var message = 'Thanks for your interest this will be the first step' var mail = row[2] var team = row[8] GmailApp.sendEmail(mail, team, "Subject", message, { attachments: [blob] }) });//your missing the parenthesis here after the arrow function }
about 4 years ago · Juan Pablo Isaza Report

0

Te faltan varios corchetes de cierre y paréntesis.

 function myFunction(){ const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet('Form Responses 1'); const url = sheet.getRange().getValues(); url.forEach(function(row,index){ if (index === 0) return; if (row[19]) return; const idFile = url.match(/[-w]{25,}/); const file = DriveApp.getFileById(idFile); const blob = file.getAs(MimeType.PDF); var message = 'Thanks for your interest this will be the first step'; var mail = row[2]; var team = row[8]; GmailApp.sendEmail(mail,team,"Subject",message,{attachments: [blob]}); }); }
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!