Forum Discussion

VisionUnlimited's avatar
VisionUnlimited
Qrew Member
3 years ago

Pipelines

I would like to have a pipeline run x# of times based on a [QTY] field in the Parent record.

I have a Parent Record and turn "checkbox" true, the pipeline runs data and Creates a Child Record with pertinent data.
I have field [QTY] in the Parent record, I would like the pipeline to run (n) times based on [Qty] output.

Is this possible?

------------------------------
Rob G.
------------------------------

3 Replies

  • Here is one way to do this but I'm sure there is more than one way.

    Create a helper table with 1000 records in it. You can do that by importing 1000 records from Excel. The record IDs of those records will be 1 to 1000.

    When your Pipeline triggers the first step can be to create a Bulk Upsert.  Then the next step would be to search the helper table and retrieve any records where the Record ID is less than or equal to the quantity in your trigger record. Then you can have a For Each step after your search to add a row to your Bulk Upsert for each search result.  Then the last step will be to commit the Upsert.

    You can also do this without creating a Bulk Upsert by just directly adding a child record for every search result. But when a For Each loop fires it fires what is called asynchronously. That means that they all fire basically at the same time.  That can overload QuickBase causing individual add record steps in the For Each loop to fail although they will automatically retry if they fail. But if you were adding too larger a number of children then I think it's theoretically possible that some of the AddRecord steps would fail.  It also puts more load on your QuickBase app to add say 100 children one by one as opposed to doing a Bulk Upsert.  That would cause the app to slow down for other users.


    EDIT:  As I recall the filter on the search results does not have a operator for less than or equal to. That's a bit annoying. It means that you have to  introduce an  OR condition to cover off your equals to. 



    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------

    • VisionUnlimited's avatar
      VisionUnlimited
      Qrew Member
      Thanks, Mark.  


      ------------------------------
      Vision Unlimited
      ------------------------------