Forum Discussion

AllisonCorrivea's avatar
AllisonCorrivea
Qrew Member
5 years ago

Creating multiple child records based on the quantity of a field in the parent table

Hi, Is it possible to create multiple child records automatically based off of a quantity field in the parent table? For example - A new parent record is created and the Order quantity field in ...
  • MarkShnier__You's avatar
    5 years ago
    There are many ways to do this and its not clear from your post if you want the user to click a button to make this happen or if the children should be created when the Parent is first saved.

    One no code solution is to use an Automation to run a save table to table import.

    The setup will be to create a table called Focus Parent with a single record in it.  It will be Record ID# = 1.  There needs to be one numeric field called [Record ID# of Focus Parent] and also a numeric field for the [# of Children needed].

    Then make a table of records called Future Children numbered from 1 to say 1,000 - whatever the highest number of children you would ever need created.  Import a set of records from Excel, and include a field for [Child Number]. 

    Then make a relationship between Focus Parent and  Future Children based on a formula numeric field called [Link to Focus Parent (=1)].  Make that be a formula field equal to 1.  Look up the â€‹value for the [Record ID# of Focus Parent] and [# of Children needed].

    Next make a save table to table copy from Future children to the Parent's child table.  Set the field mapping to assign the field for Related Parent to the [Record ID# of Focus Parent] and and include the  [Child Number] so the children will come in numbered.  Limit the filer on the records to where the [Child Number] is less than or equal to the  [# of Children].

    Lastly, decide what will trigger the Automation. For example you might want them created when the Parent is created or edited, and the [# of children needed] is >0​ but the Parent has no children yet (base that off a summary field).

    The Automation steps would be to 
    1. Edit the Focus Parent record to set the  [Record ID# of Focus Parent] and [# of Children needed].
    2. Run the saved table to table import.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------