Hey everyone,
I am new to airtable scripting and try to update records in a multiple select field (Users) the same way I do in a single select field (Workstation).
It works in the singleselect but for the multipleselect I get the following error message:
"j: Error: Failed schema validation: must be an array at main on line 19"
As far as I can tell the root as well as my value are both arrays.
Also the multiple select field appears to be in readonly and I cant figure out why.
Here is my code. I really appreciate some help.
Thank in advance.
let table = base.getTable("Bookings - FoxOMS");
let query = await table.selectRecordsAsync({fields:["Location"]});
var myString = new String();
var myStringArray = new Array();
for (let record of query.records) {
myString = record.getCellValueAsString("Location");
myStringArray = myString.split(",");
if(!myStringArray[0].includes("Edit")){
myStringArray.unshift("No Workstation selected");
}
await table.updateRecordAsync(record.id, {“Workstation”:{name:myStringArray[0]}});
await table.updateRecordAsync(record.id, {“Users”:{name:myStringArray[1]}});
}
