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

323
Views
setValue no puede cambiar los últimos datos si su valor es 'O'

Tengo una función que detectará el cambio de la hoja de Google cuando alguien escriba algo en la hoja de Google. Sin embargo, hay un problema. No puede cambiar los últimos datos si su valor es 'O'. Todavía puede enviar correo, pero setValue() simplemente no funcionó con los datos más recientes.

¿Alguien sabe cómo arreglar este problema? Aquí están los datos de mi hoja.

ingrese la descripción de la imagen aquí

 function sentMail(confirm) { var spreadsheet = SpreadsheetApp.openById('XXXXXXXX'); var sheet = spreadsheet.getSheetByName('QAAZ'); var mail = "xxx@gmail.com"; var title = "test mail" var lastRow = sheet.getLastRow(); var lastCol = sheet.getLastColumn(); var range = sheet.getRange(1,1,lastRow,lastCol); var values = range.getValues(); var rowCount = 2; var colCount = 14; Logger.log(values [rowCount][colCount - 1]); Logger.log(lastRow); lastRow = lastRow + 1; for(rowCount = 1; rowCount <= lastRow + 1; rowCount++){ if(values [rowCount][colCount - 1] == 'O'){ if(values [rowCount + 1][colCount -1] == 'O'){ sheet.getRange(rowCount, colCount).setValue('V'); sheet.getRange(rowCount + 1, colCount).setValue('V'); } else{ sheet.getRange(rowCount, colCount).setValue('V'); } GmailApp.sendEmail(mail, title, "test"); Logger.log(values [rowCount][colCount - 1]); } } }
about 4 years ago · Juan Pablo Isaza
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!