Forum Discussion

CassidyPhillips's avatar
CassidyPhillips
Qrew Member
6 years ago

Automatically create a parent record when info saved in the child reference field

Hi, I currently have two tables in a parent-child relationship: effectively I've got 100 parcels in the child table and each parcel is kept in one of ten boxes, which are kept in the parent table. Rather than using the RecordID as the key field of the parent table I'm using a text field, so each box can be individually named.

Normally when I'm importing a set of child records into a relationship like this I'll first create boxes 1-10 in the parent table, then import the list into the child table, but is this first step necessary? Is there any way that Quick Base can read the contents of the reference field in a child record and, if that information doesn't match an existing parent record, automatically create a corresponding record in the parent table?

16 Replies

  • Yes, this can be done using automations. I just learn this from Harrison today.
    You can create a lookup field  (named: has-parent) on the child record to the parent's formula checkbox field that has the formula value of true. This lookup will be true if the parent exists false otherwise. Then in the automation when a child record is modified/added and its lookup has-parent field is unchecked then create a new parent record using the child content for the reference field value.
    • DeepaPrashant1's avatar
      DeepaPrashant1
      Qrew Cadet
      I need to do this as well. But my table relation is such that each parent can have multiple children. So when multiple children are created belonging to the same parent, the Quickbase action is creating multiple parents. Is there a way for it to ascertain that it is the same parent and not create duplicates? QB support has said this is not possible and hoping you have a workaround.

      Thanks in advance!!

      ------------------------------
      Deepa Deepa
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        Are your children being created via an import or just one by one.

        If being created one by one, why will the above solution not work for you.  Does the child record know the correct value for the Parent's Key field?  What is your definition of a duplicate parent?

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