Forum Discussion

KimRavizza's avatar
KimRavizza
Qrew Cadet
2 years ago

Pipeline - Check for Duplicates when writing to a table

Good morning,

I've created a pipeline to write a tracking number to a table, but I only want to create unique records. There may be many items with the same tracking number, but I only want to write it to the table once. Is there a criteria I can use in my pipeline to check for this?

Thank you,

Kim

------------------------------
Kim
------------------------------

4 Replies

  • If the field is marked as Unique or is the Key field, you can have the Pipeline do an "upsert" using the Bulk Records step  "Prepare a Bulk Record Upsert" and then add a row to the Upsert and then commit the upsert.

    I know it seems like overkill to go through all those hoops to create an upsert and then add the single row and then commit the upsert just to get one record too upsert but maybe one day we will get a direct upsert record step so we don't have to go through all those steps.

    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------
    • KimRavizza's avatar
      KimRavizza
      Qrew Cadet
      Thanks Mark. I'll give that a try and let you know how it goes.

      ------------------------------
      Kim
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        I have found that an upsert is the safest way to create unique records. You can also use a formula query or a relationship to detect if the unique key already exists but if you create records on some mass basis like an import then multiple concurrent pipelines will spawn at the same time and they may both try to add the unique key as they will be in a race condition against each other. So an upsert will avoid that.

        ------------------------------
        Mark Shnier (Your Quickbase Coach)
        mark.shnier@gmail.com
        ------------------------------