Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

148
Vistas
How to remove elements from array if part of the string matches, google-appscript

I have an array of data like this which is from two columns of my sheet

[23849145412240785 ACTIVE, 23849143904010785 ACTIVE, 23849145429970785 ACTIVE, 23849145063370785 ACTIVE, 23849431077940785 PAUSED, 23849431077950785 ACTIVE, 23849431351900785 PAUSED, 23849433608970785 ACTIVE, 23849433622310785 ACTIVE, 23849433609000785 ACTIVE]

const ss = SpreadsheetApp.getActive();
let data = ss.getSheetByName('sheet1').getRange(2, 5, ss.getLastRow() - 1, 7).getValues();

function buildAlert(data) {
let   idStatus = data.map(function(column) {
   return column[0] +'  ' + column[5];
});
Logger.log(idStatus)


 let payload = {
   "blocks": [
     {
       "type": "section",
       "text": {
         "type": "mrkdwn",
         "text": ""
       }
     },
     {
       "type": "divider"
     },
     {
       "type": "section",
       "text": {
         "type": "mrkdwn",
         "text": idStatus
       }
     }
   ]
 };
 return payload;
}

And I am trying to remove all items from the array which contain PAUSED and add them to a new array. What is the best way to do this? thanks

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda