Airtable Scripting - Delete Duplicates

Поділитися
Вставка
  • Опубліковано 1 лют 2025

КОМЕНТАРІ • 22

  • @AyaNori
    @AyaNori 10 місяців тому

    Good on you for showing how to delete more than 50 records because my project definitely needs that 😅 thank you!

  • @bradlegassick9327
    @bradlegassick9327 2 роки тому +2

    Rupert thanks a million this is great content! I asked & you delivered! Cheers

  • @dominicrannie9102
    @dominicrannie9102 2 роки тому +2

    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?

  • @ediesellers526
    @ediesellers526 Рік тому

    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".

    • @rupertxyz
      @rupertxyz  Рік тому +1

      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

  • @mariuszjankowski3593
    @mariuszjankowski3593 Рік тому +2

    Hi, can this script be used to automatically remove duplicate records? Do you have such a version?

    • @rupertxyz
      @rupertxyz  Рік тому +1

      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!

    • @mariuszjankowski3593
      @mariuszjankowski3593 Рік тому

      ​@@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 ;)

    • @rupertxyz
      @rupertxyz  Рік тому

      @@mariuszjankowski3593 If you send me a video via Twitter DM (twitter.com/rupertxyz), I'm happy to have a look at it :)

    • @rupertxyz
      @rupertxyz  Рік тому

      @@mariuszjankowski3593 If you send me a video via Twitter DM, I'm happy to have a look at it! twitter.com/rupertxyz

    • @mariuszjankowski3593
      @mariuszjankowski3593 Рік тому

      @@rupertxyz ok, sure. Send it ;)

  • @JorgeGonzalez-op8uz
    @JorgeGonzalez-op8uz Рік тому

    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?

  • @bradlegassick9327
    @bradlegassick9327 2 роки тому +1

    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
      @rupertxyz  2 роки тому

      Hi Brad, thanks! In your example: These two new products are different from each other, correct? Or twice the same product? Thanks for clarifying!

    • @bradlegassick9327
      @bradlegassick9327 2 роки тому

      @@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.

  • @michaelreed4586
    @michaelreed4586 2 роки тому +1

    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!

    • @rupertxyz
      @rupertxyz  2 роки тому

      Please send an email to rupert.hoffschmidt[at]gmail.com. Thanks!

  • @DanPolonskiy
    @DanPolonskiy Рік тому +1

    It's JavaScript?