One of the inputs to my script is a string which needs to be reformatted such that it will be an acceptable value for a multiselect field when creating a new record.
There are three possibilities for the string:
- âoption 1â
- ââ
- many options: âoption 1, option 2, etcâ
I know the format below is what I need to convert it to, but I canât figure out how.
await table.createRecordAsync({
âMultiple Select Fieldâ: [{name: option1}, {name: option2}, etc]
})
Iâm omitting all the things Iâve tried which havenât worked. Iâm going to use the create records action instead of a script action until I can figure this out. Below is the skeleton of the script action I was using with some ??? where I was stuck.
Any help would be greatly appreciated! In the meantime, Iâm leveling up my Javascript skills.
let config = input.config();
let recordID = config.recordID;
let table = base.getTable("Table_Name");
let view = table.getView("View_Name");
let query = await view.selectRecordsAsync({
fields: ["String_Field"]
});
let record = query.getRecord(recordID);
let multi_select_field;
const getRelevantValues = newSubmission => {
multi_select_field = record.getCellValueAsString("String_Field");
}
getRelevantValues(record);
// Create Meetings record
table = base.getTable("Meetings");
await table.createRecordAsync({
"Multiple Select Field": ???
})

