I am trying to, with scripting, link multiple records to one record. The code I have below succesfully links one record, and I’ve tried using a for loop, as well as a forEach to get it to cycle through the record Ids in the ‘matchTKRecords’ array. I’ve attached a picture of the console.log output for the matchingTKRecords array.
To clarify - my aim is to link the VMrecordID record to any/all of the records in matchingTKrecords
The error I get is always some variation on:
Error: Field "Linked tickets" cannot accept the provided value. at main on line 46
what I don’t understand is why an array of record IDs is not accepted as a write value for a linked tickets field (it is set-up correctly as a ‘link to another record’ field). Linking to multiple records is enabled
let newForeignRecordIdToLink = matchingTKRecordsc0].id;
VMtable.updateRecordAsync(config.VMrecordID, {
'Linked tickets': k{ id: newForeignRecordIdToLink }]
})
Thank you in advance for any assistance!