Hi,
I need to iterate and create multiple linked records in table2 from table1 (without selecting them). But when I run my code I get the following error: “Can’t create records: invalid cell value for field ‘Property’.
Cell value has invalid format: .0.0 must be an object.
Linked records field value must be an array of objects with property ‘id’ corresponding to linked record id.”
I assume I have to put the linked record id in the createRecordAsync function, but I don’t know how the syntax for that should be.
Here is the full code. Thank you!
let importTable = base.getTable('Master List');
let importView = importTable.getView('Active View');
let importQuery = await importView.selectRecordsAsync();
let secondTable = base.getTable('Table2');
for (let record of importQuery.records) {
let fullName = record.getCellValue('Name');
await peopleTable.createRecordAsync({
"Person": fullName
})
output.text(`New record for ${fullName} created!`);
}