Right now I have a multiple select field as follows:
The script I’m trying to run has already identified the record IDs of all records with “Split Invoice” as a status.
What I’m trying to do now is to remove that split invoice status and leave the rest (For example Estimated, Invoiced, those can all stay).
What’s the best way to do this? All I can think of is to create an array of all statuses except for “Split Invoice” but I’m not sure how to write the syntax for that either. Code below:
let table = base.getTable("Items");
let queryResult = await table.selectRecordsAsync();
var rec_IDs = >]
var rec_names = v]
for (let record of queryResult.records) {
try {
for (let status of record.getCellValue("Status")) {
if (status.name === "Split Invoice") {
rec_IDs.push(record.id);
rec_names.push(record.name);
}
}
} catch(e) {
{
continue;
}
}
}
// Script operations go here
// As a final step, remove "Split Invoice"
So if possible I’d like to use the array of rec_IDs to update the Status field to have the exact same values, minus “Split Invoice”, but I’m drawing blanks here. Any pointers would be hugely appreciated, thank you.