Title.
I am still getting the hang of scripting, Airtable, and scripting for Airtable. Goal of script:
- User chooses up to two options in multi-select field.
- Those multi-select options are 1:1 with the names of the records that are being linked. (IDs are included regardless).
- Link those up to two records from the Signature Hardware Vendor multi-select field into the Vendor(s) linked records field.
Ill gladly take hints on updating or fixing my bad code leading up to the portion in question, but I can confirm everything shown below is working BESIDES the linking of two different records.
const { recordId , QASubtype, SHVendor} = input.config();
const table = base.getTable('tblFvUDsFR14aJ8Nu');
if (QASubtype==="Signature Hardware Quick Add"){
await table.updateRecordAsync(recordId,{
"Manufacturer(s)": [{ id: 'recBUCS8K6yzHS1Nd' }]
});
if (SHVendor==="Signature_Hardware - 1481"){
await table.updateRecordAsync(recordId,{
"Vendor(s)": [{ id: 'recyW5pRLYxqFIMkt' }]
});
};
if (SHVendor==="All Ferguson (Group)"){
await table.updateRecordAsync(recordId,{
"Vendor(s)": [{ id: 'recSIDlhGWnWdlpdv' }]
});
};
if (SHVendor==="Signature_Hardware - 1481, All Ferguson (Group)" || SHVendor==="All Ferguson (Group), Signature_Hardware - 1481"){
table.updateRecordAsync(recordId,{
"Vendor(s)": [{ id: 'recyW5pRLYxqFIMkt' }]
});
await table.updateRecordAsync(recordId,{
"Vendor(s)":[
...recordId.GetCellValue('Vendor(s)'),
{ id: 'recSIDlhGWnWdlpdv' }
]
});
};
};



