Hey, I'm getting a time limit error for the below script only for some records.
let table = base.getTable("Photos"); // Change "YourTableName" to your actual table name
let query = await table.selectRecordsAsync();
// Object to hold the count of each Claim-Fault combination
let counts = {};
// First pass to count occurrences
for (let record of query.records) {
let claimNumber = record.getCellValue("Claim Number");
let faultNumber = record.getCellValue("Fault No.");
let identifier = `${claimNumber}-${faultNumber}`;
if (counts[identifier]) {
counts[identifier].push(record.id);
} else {
counts[identifier] = [record.id];
}
}
// Second pass to update the Index field
for (let identifier in counts) {
let recordIds = counts[identifier];
for (let index in recordIds) {
await table.updateRecordAsync(recordIds[index], {
"Index": "." + index
});
}
}
console.log("Indexing complete.");
Is there anyway to extend the time limit?