Hi, Does anyone know how to fix this error my script is throwing? I originally used the script function to avoid the 100 record limit of find records…I put stars around the line where the script has issues.
let inputConfig = input.config();
let table = base.getTable("Companies");
let records = inputConfig.triggerRecords
let interactionDate = new Date(inputConfig.interactionDate)
let updates = new Array
**let companyRecords = await table.selectRecordsAsync({**
** recordIds: records**
})
for (let companyRecord of companyRecords.records) {
let companyInteractionDate = new Date(companyRecord.getCellValue("Date of Last Interaction"))
if(companyInteractionDate.getTime() < interactionDate.getTime()){
updates.push({
id: companyRecord.id,
fields: {
"Date of Last Interaction": interactionDate
}
})
}
else{
updates.push({
id: companyRecord.id,
fields: {
"Date of Last Interaction": companyInteractionDate
}
})
}
}
while (updates.length > 0) {
await table.updateRecordsAsync(updates.slice(0, 50));
updates = updates.slice(50);
}
Thanks!!
