Ok, I have this script, but I need to check only for duplicates in the same table. Thoughts on what I need to add to ensure the record pulled is not self linking in linked records?
//Define the table and query
let jobTbl = base.getTable(“Caregiver Applicants”);
let appQuery = await jobTbl.selectRecordsAsync();
//Loop through the records and find the Applicant
for (let record of appQuery.records) {
let appname = record.getCellValue("E-mail");
//Define linked table and query
let applicantTbl = base.getTable("Caregiver Applicants");
let applicantQuery = await applicantTbl.selectRecordsAsync();
//Loop through linked table and match ID values
for (let appRecord of applicantQuery.records) {
if (appRecord.getCellValue("E-mail") === appname) {
let inputid = appRecord.id;
//Update field
jobTbl.updateRecordAsync(record, {
"Additional Records": [{id: inputid}]
});
}
}
}
This ends up linking the original record to itself. Ugh.