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

459
Views
Recibiendo [Ljava.lang.Object en Apps Script (llevando el nombre del archivo adjunto de Gmail a Sheets)

Estuve trabajando en una secuencia de comandos de aplicaciones para llevar la información del mensaje de Gmail (remitente, asunto, enlace, archivo adjunto) a una hoja de Google, pero no pude traer el título del archivo adjunto con éxito (el campo de nombre del archivo adjunto en la hoja de Google se lee como [Ljava.lang.Object;@127afe9 ; parece estar relacionado con la matriz de archivos adjuntos, pero no puedo entenderlo. Probé las soluciones ofrecidas en ¿Qué significa "[Ljava.lang.Object;@"? , pero no tuve suerte.

 function emailToSheet() { var label = GmailApp.getUserLabelByName('New TODO'); // Find messages with label var changeLabel = GmailApp.getUserLabelByName('TODO'); // Change message label to var ss = SpreadsheetApp.openById('xxxx'); // Append to spreadsheet var sh = ss.getSheetByName("Email"); //On this sheet var threads = label.getThreads(); for (var i=0; i<threads.length; i++){ var messages = threads[i].getMessages(); for (var j=0; j<messages.length; j++) { var sent = messages[j].getDate(); var from = messages[j].getFrom(); var subject = messages[j].getSubject(); // Get attachment name var attachments = messages[j].getAttachments(); var attachmentName = []; for (var k=0; k<attachments.length; k++) { var attachmentName = attachments[k].getName(); } var messageId = messages[j].getId(); var messageUrl = "https://mail.google.com/mail/u/0/#inbox/" + messageId; ss.appendRow([sent, from, subject, attachmentName, messageUrl]) } threads[i].removeLabel(label); threads[i].addLabel(changeLabel); } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Estoy pensando que quieres esto:

 var attachmentName = []; for (var k=0; k<attachments.length; k++) { var attachmentName = attachments[k].getName(); }

ser esto:

 var attachmentName = []; for (var k=0; k<attachments.length; k++) { attachmentName.push(attachments[k].getName()); }

y tal vez esto:

 ss.appendRow([sent, from, subject, attachmentName, messageUrl])

ser esto:

 ss.appendRow([sent, from, subject, attachmentName.join(" "), messageUrl])
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!