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