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

145
Views
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
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!