Forum Discussion

BrianPetzold's avatar
BrianPetzold
Qrew Member
2 years ago

Maintaining data integrity with pipelines and grid edit

I have a pipeline where the first step searches for a record in a parent table. If no match is found, it creates the parent record. If a match is found, it skips creating the parent record and moves on to add the child record. This works great when used in Edit mode from a single record, but causes problems when someone tries to enter multiple records using Grid Edit mode. Because the pipelines run virtually simultaneously, I have seen cases where duplicate parent records are created. I can mitigate this by adding a unique field to detect duplicate records, but when this occurs the pipeline for that record will stop and the child record will not be created.

What is the magic method to ensure data integrity when adding records through pipelines while using Grid Edit mode?

------------------------------
Brian Petzold
------------------------------
  • I had the identical problem.
    My solution was  to have a Pause Sep using the clock function which caused a random pause before searching for the Patent.

    The duration of the pause with this

    {{ range(1, 2000) | random /100}}seconds

    which generated a pause from 0 to 20 seconds. 

    The concept was that instead of being essentially simultaneously triggered to to search and then create the parent record if needed, the competing trigger records would have to wait their turn randomly.  It didn't work perfectly to prevent pipeline errors but it improved it a lot.  


    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------
  • A crazy idea: must be unique in a reference/Id/billnum/other    field , and the system doesn't create the 2nd record.

    Marcelo Benavides Torres