Forum Discussion

JasonBeaver's avatar
JasonBeaver
Qrew Cadet
5 years ago

Best Way - Copy a record a number of times

Looking for suggestions

I want to be able to copy a record based on a number field within the original record.

For example - A user enters a record for a number of pizzas on an order.  I want the user to only create the order one time and have the system (thru automations, maybe) create the additional records.  So if the number of pizzas was 10 on the order.  The user would create the first record and the system would generate the additional 9 records.

------------------------------
Jason Beaver
------------------------------

5 Replies

  • So these are child lines on an order?  And the order knows the number of lines required. 

     I have a couple of ideas. Can you tell me what the most number of lines the solution needs to handle?

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Qrew Champion
       So here are my two approaches.
      The simplest way is to set up an automation which will create, sa6, 20 child records. The automation would be triggered by a child record being created and a summary look up from the parent telling the child record that it in fact was the lucky one which was the first child.
      The automation would create say 20 children each numbered from 2 to 20 respectively. Then the last step of the Automation would  delete any children where is their assigned child number was greater than the number of children called for on the parent record.
      It doesn't sound like you would need more than  20 or 30 based on your pizza example.
      But if you did want to generalize this to a higher number. I have done automations in the past where the automation creates a record and then updates a counter to the previous value of the counter plus one. And then the last step of the automation triggers that same automation to run again. That is to say it is possible to make a looping automation that calls itself. You just have to make sure that you don't create an infinite loop and there is a condition where the automation knows when to stop running.
       But my first suggestion is simpler to set up. Just create a fixed number of records and then the last step of the automation will delete all the extra ones that you didn't need. 


      ------------------------------
      Mark Shnier (YQC)
      Quick Base Solution Provider
      Your Quick Base Coach
      http://QuickBaseCoach.com
      mark.shnier@gmail.com
      ------------------------------
      • JasonBeaver's avatar
        JasonBeaver
        Qrew Cadet
        The records are not child records.  They would be parent records, so I am not sure how to create the summary field. 

        Sorry, I am new to automations.  How do you create a copy loop in automations?

        ------------------------------
        Jason Beaver
        ------------------------------