Thanks Rupert. Fantastic video with a prefect pace. I would like to exclude records from the deletion step, where the field being checked for duplicates has no value (NULL). What would be the best way to add this check to your script?
Good lord this is helpful!!! I do have one question (because I'm a non-coder but already understand way more just from your explanation): how to you filter the dTableRecords array to filter for identical field values EXCEPT "null" or empty fields? Seems like there's some way to indicate !== i AND "null".
In the filter step you would have to add another condition, so after comparing to the index you could do something like " || !rec.field" in the example above. This is not tested, but basically says "include if the index is equal OR if no field value is present". Hope that helps! :) I do have a scripting course coming up, specifically for Airtable if you're interested: airtable.com/appkftPsXAM2dpUwQ/shrKweL66AExgD3Zb
You would need to write a script action for an automation, which is quite similar to the approach in this video. The input.config wouldn't come from settings, but from the input variables set on the left side in the code editor. I'll make a video about this at some point!
@@rupertxyz I wrote such a script and it works. Only I can't get the input.Config() variables, so I set them in variables to hard. I will be grateful for Video ;)
Hi is there a way this works but it scans lines instead of a record? For example in a record i may have multiple exact urls one below the other. And instead of deleting them to have them marked or highligthed or a count of how many duplicates?
Hi Rupert I have run into a challenge which you might find interesting enough to make another video on it? I have a table of products. The products have unique codes. I compare new items coming into the base by product code. If the product code doesn't exist I create the product. I am experiencing some situations where the product doesnt exist but there are 2 "new" products in the same data array & this is resulting in 2 "New" products being created. I have tried using the delete duplicates & filtering methods but still no success. The elements in the array which are being compared & potentially created have multiple values like "Cost", "Unit", "Code" etc. I now need to compare the codes of the new product array to remove duplicates. My JS is not very good & I am struggling with this. Any tips from your channel are appreciated! Cheers
@@rupertxyz these products are 2 the exact same - Ex: The products supplied can have "purchasing" agreements whereby you are supplied 1 "free" product for every 12 of those products purchased. The "Free" product can be listed as its own row in the data with a zero cost, where as the same 12 products "purchased" have a cost of $10 each. This can create a situation where we have a new product enter the table twice, once with a cost of zero & once with an actual cost of $10. I need to remove the $0 cost item & keep the item with an actual cost, then create that item in the products table. I can do this no problem if there is no repeat item, however when this situation arises I am getting 2 items created, one with zero cost & 1 with an actual cost. Does that help explain the challenge better? Cheers for the help.
Great video! This is probably a dumb way to ask for help, but I have no experience with coding or scripts, and I need some help! Your script does everything I need... except for the delete part. Any chance you could tell me what the script would be to flag the offending youngest/oldest record (instead of deleting it) using a checkbox field called "Duplicate?" In other words, I want to mark the potential duplicate for review, rather than deleting it immediately. Thank you!
Good on you for showing how to delete more than 50 records because my project definitely needs that 😅 thank you!
Rupert thanks a million this is great content! I asked & you delivered! Cheers
Thanks Rupert. Fantastic video with a prefect pace. I would like to exclude records from the deletion step, where the field being checked for duplicates has no value (NULL). What would be the best way to add this check to your script?
Good lord this is helpful!!! I do have one question (because I'm a non-coder but already understand way more just from your explanation): how to you filter the dTableRecords array to filter for identical field values EXCEPT "null" or empty fields? Seems like there's some way to indicate !== i AND "null".
In the filter step you would have to add another condition, so after comparing to the index you could do something like " || !rec.field" in the example above. This is not tested, but basically says "include if the index is equal OR if no field value is present". Hope that helps! :)
I do have a scripting course coming up, specifically for Airtable if you're interested: airtable.com/appkftPsXAM2dpUwQ/shrKweL66AExgD3Zb
Hi, can this script be used to automatically remove duplicate records? Do you have such a version?
You would need to write a script action for an automation, which is quite similar to the approach in this video. The input.config wouldn't come from settings, but from the input variables set on the left side in the code editor. I'll make a video about this at some point!
@@rupertxyz I wrote such a script and it works. Only I can't get the input.Config() variables, so I set them in variables to hard. I will be grateful for Video ;)
@@mariuszjankowski3593 If you send me a video via Twitter DM (twitter.com/rupertxyz), I'm happy to have a look at it :)
@@mariuszjankowski3593 If you send me a video via Twitter DM, I'm happy to have a look at it! twitter.com/rupertxyz
@@rupertxyz ok, sure. Send it ;)
Hi is there a way this works but it scans lines instead of a record? For example in a record i may have multiple exact urls one below the other. And instead of deleting them to have them marked or highligthed or a count of how many duplicates?
Hi Rupert I have run into a challenge which you might find interesting enough to make another video on it? I have a table of products. The products have unique codes. I compare new items coming into the base by product code. If the product code doesn't exist I create the product. I am experiencing some situations where the product doesnt exist but there are 2 "new" products in the same data array & this is resulting in 2 "New" products being created. I have tried using the delete duplicates & filtering methods but still no success. The elements in the array which are being compared & potentially created have multiple values like "Cost", "Unit", "Code" etc. I now need to compare the codes of the new product array to remove duplicates. My JS is not very good & I am struggling with this. Any tips from your channel are appreciated! Cheers
Hi Brad, thanks! In your example: These two new products are different from each other, correct? Or twice the same product? Thanks for clarifying!
@@rupertxyz these products are 2 the exact same - Ex: The products supplied can have "purchasing" agreements whereby you are supplied 1 "free" product for every 12 of those products purchased. The "Free" product can be listed as its own row in the data with a zero cost, where as the same 12 products "purchased" have a cost of $10 each. This can create a situation where we have a new product enter the table twice, once with a cost of zero & once with an actual cost of $10. I need to remove the $0 cost item & keep the item with an actual cost, then create that item in the products table. I can do this no problem if there is no repeat item, however when this situation arises I am getting 2 items created, one with zero cost & 1 with an actual cost. Does that help explain the challenge better? Cheers for the help.
Great video! This is probably a dumb way to ask for help, but I have no experience with coding or scripts, and I need some help! Your script does everything I need... except for the delete part. Any chance you could tell me what the script would be to flag the offending youngest/oldest record (instead of deleting it) using a checkbox field called "Duplicate?" In other words, I want to mark the potential duplicate for review, rather than deleting it immediately. Thank you!
Please send an email to rupert.hoffschmidt[at]gmail.com. Thanks!
It's JavaScript?
Yes :)