Hello,
In my Airtable's "PEOPLE" Table, we stored many people's name records—more than 15,500 records. I aimed to identify those name records whose spelling is the same as any particular person's name. I developed the following scripting codes using the Scripting Extension in Airtable. When I tested it with another table with a small number of name records, less than 10, it worked well. However, when testing the code with a table with many people's names, the script's running was not complete. This issue could be related to the large number of records in the Table. Please note the following regarding my "PEOPLE" Table: 1) Table name: PEOPLE, 2. Primary field name: English Name, and 3. "Duplicate Name" is a checkbox field, which means if a tick is created for any name, that name has more than one record. Please see my scripting codes below:
//Read our table
var table = base.getTable('PEOPLE');
var query = await table.selectRecordsAsync();
//Identify duplicates
//loop through all of the records
let duplicates=query.records.filter((record)=>{
return query.records.find((potentialDuplicate)=>{
//compare record to potentialduplicate
return record.getCellValue("English Name")=== potentialDuplicate.getCellValue("English Name") && record.id !==potentialDuplicate.id;
})
});
let updates = duplicates.map(update=>{
return {
"id":update.id,
fields:{
"Duplicate Name": true
}
}
});
await table.updateRecordsAsync(updates);
I look forward to hearing from all of you who can help with this.