I'm joining you from Puerto Rico. I'm a pretty new developer. I've dabbled in python. I'm here because I need to automate something in AT and unable to figure out how to do it through automations so trying my hand at writing a script.
Hey Aaron, loved the session and was great learning. I had tried the script ,had problem at the line :await table.updateRecordsAsync(updates). It throws error that field 'Duplicate?' does nor exist in my table. Would appreciate if you can come will resolution.
I found fantastic this lesson. I tried to use this solution in a table with about 1k records, but using the script in automation, such as whenever a new record is created, check if it's duplicated. But as the script takes about 1min, it doesnt work in automation, once it's allowed script running during up 30sec. Do you have a way do make it faster?
I really like this method, thank you! Just to note though, that this method won't *clear* the duplicate flag once a record has been updated to have non-duplicated value.
Thanks for the nice video ! Is it possible to differentiate the old duplicate from the newest one ? In my case, I want to find duplicate - Keep the wen one and delete the old one. Thanks for your help !
Heyo! Yup, basically you can tag the one that just came in as new and then the one you find as old. You can use the delete method to delete whichever you prefer from the script! Hope that helps!
I was looking to do something similar and found that using this helped, though this is to keep the older date : record.getCellValue("Allocation Date") > potentialDup.getCellValue("Allocation Date")
I appreciate how you go through this slowly and clearly, HOWEVER... when I put this script into my base, I immediately received a bunch of error messages with "Methods" and Fix options that made me lose all understanding of what you explained in the video. also there was a depreciation of code you used... #clueless #reallybadatthis #sigh
HI Shrizz, I imagine this is because of "selectRecordsAsync" which now requires to specific which fields you want to select in the records. That said, the code should still run, if it doesn't could you shoot me an email at aron@aatt.io with the issue and I'll see if I need to add a disclaimer/update in the description. Thanks!
Hi Thanks for update its really very useful . my Question is if the table contain 100k Record , How is the speed & performance of the checking the duplicates .
Hi Sakthivel, Airtable shouldn't be used for such large DBs unfortunately so yes you'll probably hit performance issues looking for duplicates in that large of a dataset.
thanks guys appreciate this ..a bit stuck as i am using this method to avoid dateoverlapping for appointment and pushing a new date for the appointment if date already exist. will appreciate your help please
Hi Emmanuel, dates can be a little tricky in javascript! We don't cover this specifically but I'd recommend reaching out to the Airtable community for specific questions!
How about filtering out cells that have blank values??? i have a column of values that contain values (that need to be checked for duplicates) or should be blank. been trying for a while but cant figure it out
Hi Daryl, you can adjust the condition to check for blank! Here are some pointers on how to do that depending on what your field type is (string, linked recrd) stackoverflow.com/questions/154059/how-can-i-check-for-an-empty-undefined-null-string-in-javascript
You should use filter as well.. But to check, you should at first extract from cell. It's like: let nonblanks=query.records.map(x=>x.getCellValue('some_field').filter(n=>n) but be careful with numbers, filter() expects boolean true/false result after "=> " , so '0' will be converted to 'false' same as nuil values.
Hey Temmie, you can a script on a schedule (every minute/hour/day for instance) using airtable automations. Check out part 3 of this series where we do exactly that!
Great tutorial, very helpful! I think it would be worth it to edit o try to be more concise, the video could be lasting 20-30 minutes while having the same content.