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

386
Views
¿Cómo puedo configurar el color de los valores de celda de fondo usando la matriz ** .push ** en el script de la aplicación?

He estado tratando de cambiar el color de fondo del valor de la celda según el ESTADO . Si el estado es ARCHIVO ANTIGUO , me gustaría establecer el color de fondo de la celda en rojo , y si el estado es ARCHIVO NUEVO , me gustaría establecerlo en verde (como se muestra en la muestra).

ingrese la descripción de la imagen aquí

Aquí está el código:

 const cells = sheet.getRange("I2:I" + sheet.getLastRow()) const cellValues = cells.getValues() Logger.log(cellValues) const newValues = [] var backGrounds = [] cellValues.forEach((row) => { if (row[0] === "new file") { newValues.push(['OLD FILE']) } else if (row[0] === "OLD FILE" || row[0] === "NEW FILE") { newValues.push([row[0]]) } else { newValues.push(['NEW FILE']) backGrounds.push(['00ff00']) } }) cells.setValues(newValues).setBackground(backGrounds) }

He intentado usar backGrounds.push(['00ff00']) y .setBackground(backGrounds) pero aún no cambia.

¿Cómo puedo cambiar el color de fondo de la celda según el estado?

about 4 years ago · Santiago Trujillo
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!