Hi @Lucas_Ravassallo
There is a free dedupe application in the marketplace that you can run to find and merge duplicates.
Hi,
You don’t need a script for it, if you want it to be done in real time.
You should add an automation that runs for each “Record created”.
Action will be “Find records” in your table, condition - email=email from new added record.
Then it should contain conditional action based on the length of ‘Find Records’ answer, like this

Action should update some field by your choice. To update checkbox field, you can put 1 or 0 into it. Also it can be true/false(or space, I don’t remember 100%)
For checking duplicates via script run, you can use this script, adjusting first 2 lines
const table=base.getTable('Your Table')
const [CHECK,MARK,HASDUP,DUP,UNIQ]=['field to check','field to mark','Has duplicates','Duplicate','Unique']
const query=await table.selectRecordsAsync({fields:[check]})
const values=new Map(query.records.map(rec=>[rec.getCellValue(CHECK),rec.id]))
const others=query.recordIds.filter(id=>(![...values.values()].includes(id)))
const othervals=new Set(others.map(id=>query.getRecord(id).getCellValue(CHECK)))
const uniq=[...values.keys()].filter(val=>!othervals.has(val))
const upd=query.records.map(rec=>({'id':rec.id,'fields':{[mark]:uniq.includes(rec.getCellValue(CHECK))?
UNIQ: others.includes(rec.id)? DUP:HASDUP}}))
while (upd.length) await table.updateRecordsAsync(upd.splice(0,50))
If you’re still looking for solutions for flagging duplicate records I recommend checking out what we made at zzBots. Here is a link to our community forum that includes written and video instructions of how to install our " Airtable Flag Duplicate Records" plugin (pre-built bot).
I hope you find this helpful:)
For checking duplicates via script run, you can use this script, adjusting first 2 lines
const table=base.getTable('Your Table')
const [CHECK,MARK,HASDUP,DUP,UNIQ]=['field to check','field to mark','Has duplicates','Duplicate','Unique']
const query=await table.selectRecordsAsync({fields:[check]})
const values=new Map(query.records.map(rec=>[rec.getCellValue(CHECK),rec.id]))
const others=query.recordIds.filter(id=>(![...values.values()].includes(id)))
const othervals=new Set(others.map(id=>query.getRecord(id).getCellValue(CHECK)))
const uniq=[...values.keys()].filter(val=>!othervals.has(val))
const upd=query.records.map(rec=>({'id':rec.id,'fields':{[mark]:uniq.includes(rec.getCellValue(CHECK))?
UNIQ: others.includes(rec.id)? DUP:HASDUP}}))
while (upd.length) await table.updateRecordsAsync(upd.splice(0,50))
I tried your script
by changing the second line like this
const [CHECK,MARK,HASDUP,DUP,UNIQ]=['PHONE','duplicates','A duplicates','Duplicate','Unique']
I just want a script that iterates through the phone column customer table and checks for duplicate phones
THANK YOU
I receive this message
ERROR Error
: the field "fldHrLg5ZiN1ETeaY" cannot accept the value provided.
to main line 10