Hi all, Iām trying to link my a āparentā record to new created records in a script following this source. But I keep on getting the error āTypeError: newRecordId.getCellValue is not a functionā.
The code can be found under " /Link the new record (child) to the parent record/".
Thanks for the help in advance⦠itās very much appreciated!
let inputConfig = input.config();
let table = base.getTable('Progress General Indicator š«');
let projectsTable = base.getTable('Projects š');
let indicators = inputConfig.linkedIndicatorIDs;
let projectID = inputConfig.projectID;
let recordID = inputConfig.recordID;
let linkedIndicators = inputConfig.linkedIndicators;
/*Create new records (children)*/
for (let indicator of indicators) {
console.log(`Adding indicator ${indicator} to the new record.`);
console.log(`Adding project ${projectID} to the new record.`);
let newRecordId = await table.createRecordsAsync([
{
fields: {
/*'Projects š': [{id: projectID}],*/
'General indicators š': [{id: indicator}]
}
}
])
console.log(`Added record ${newRecordId}.`);
/*Link the new record (child) to the parent record*/
let existingLinkedRecords = newRecordId.getCellValue('Optional: Link to other indicators');
table.updateRecordAsync(recordID, {'Optional: Link to other indicators': [existingLinkedRecords,{ id: newRecordId.id }]})
}

