Could someone share the correct way to update a multiple select field using a script?
I have one table where I receive data from form submissions. When a submission is received, I use data from the submission to update a multiple select field in a record in another table. When I manually type my field update, as below, the script accepts the value:
await table.updateRecordAsync(id,{
'Multiple Select Field': [{ name:example1 }, { name: example2 }]
})
However, when I use JSON.parse() to create an array of objects with name keys and values using my submission data I receive a 'cannot accept provided value' error:
//My raw data is brought into an automation script as an input. Here is an example of the format:
let rawData = ["example1", "example2"]
//Here, I convert my rawData into objects with keys and values
let data = rawData.map(datum => JSON.parse(JSON.parse('{ "name":"'+datum+'" }'));
//Here, I attempt to update my table using the parsed data
await table.updateRecordAsync(id,{
'Communications Preferences': data
})
Shouldn't the parsed data be equivalent to the array I've written out above? When I console log it, it gives me an array of objects just like that array. Can anyone explain why I am getting an error, or what I need to do differently? Thanks in advance!