Associate existing child record to existing parent record from parents table.

  • 1
  • 2
  • Question
  • Updated 3 months ago
  • Answered
I have two related tables, a Parent and a Child. The way users typically use my app, they often find themselves wanting to associate new Children to a Specific Parent record, without actually knowing what specific Child records they might want. 

Right now if I want to associate an existing child record with a specific Parent, I have to remember that Parent name, then go into the Child table and search for a relevant Child.

Since in my case searching for a relevant Child might be a long and involved process, it is easy to lose track of which Parent you are intending to associate the Children with. 

What would be more useful is if there was a way to, from from a specific Parent record, generate a report of all un-linked Child records, and easily associate them with that specific Parent.

I have been looking into generating such a report using the Quickbase API and a formula URL field on the Parent table, but so far no luck.

This is an odd and specific case, so I would not be surprised if it wasn't possible, but it would be surprisingly helpful for our workflow. 

Thanks. 
Photo of Alex Gale

Alex Gale

  • 1,376 Points 1k badge 2x thumb

Posted 10 months ago

  • 1
  • 2
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,924 Points 50k badge 2x thumb
I do this all the time for my clients, but the process is a bit too complicated to explain here.  basically my process is that you launch off a Parent record  into a report of children with no parents.  You can then click click click on as many children as you like and have full access to the dynamic filters and search box on a regular table report.  Then click a button to get back to your parent and you will see your Parent with all its children now attached.

Contact me via the information on my website if you would will like me to set this up for you and teach you the technique to use in future.  It involves no "javascript" , all native Quick Base.

My contact info is at QuickBaseCoach.com

It usually takes about 1.5 hours to set this up and do the training so you understand what I have done and could replicate it if you need the technique for another similar situation. 
Photo of Tate Forgey

Tate Forgey

  • 632 Points 500 badge 2x thumb
Okay - daftness it is.  For posterity I'll note the embarrassing source of my confusion. 

I was so focused on the relationship with the User Focus table and the table that held the records that would be assigned that when you said you pushed the [User Exists?] field to the details table I thought you meant to that "assignee" table. I neglected to realize you were also talking about re-setting the reference field in the relationship between the User Focus table and the table where the parent records are contained.  I had had created a "normal" relationship there with the User Focus table as a child.  I deleted that relationship, reversed it, and used the user reference trick there.  That allowed me to push down the [User Exists?] field to the formula in the parent table exactly as you specify.

All works now and no user maintenance!  Brilliant!
Photo of Tate Forgey

Tate Forgey

  • 632 Points 500 badge 2x thumb
Okay - daftness it is.  For posterity I'll note the embarrassing source of my confusion. 

I was so focused on the relationship with the User Focus table and the table that held the records that would be assigned that when you said you pushed the [User Exists?] field to the details table I thought you meant to that "assignee" table. I neglected to realize you were also talking about re-setting the reference field in the relationship between the User Focus table and the table where the parent records are contained.  I had had created a "normal" relationship there with the User Focus table as a child.  I deleted that relationship, reversed it, and used the user reference trick there.  That allowed me to push down the [User Exists?] field to the formula in the parent table exactly as you specify.

All works now and no user maintenance!  Brilliant!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,924 Points 50k badge 2x thumb
OK, so good job getting that to work with limited instructions!

Yes, the self maintenance part is what makes it elegant.  You do not have to worry about a new user touching the app for the first time and having it fail for them right out of the gate.
Photo of Tate Forgey

Tate Forgey

  • 632 Points 500 badge 2x thumb
In retrospect this seems like an obvious issue, but I realized when a record is first created if you hit this formula button it does not function properly even if when you indicate you want to save the record in the stock Quick Base message you get about saving the record before leaving the page.  It looks like the ID has not yet been created before this formula is executed, which totally makes sense since you already clicked the button.

I looked through the forums and saw some complicated techniques for saving a record before moving on, but ultimately I just created a rich text button that duplicates the save and keep working functionality that I'm going to call "Save to Assign" and use the form properties to only display that when the form is used for add.  Then, I also use form properties to indicate the URL formula button should only be displayed when the form is used for edit or view.

This seems pretty low-tech and does require an extra click to get to the assign button.  So, I'm open to suggestions here if there is a way to combine these, but because they are both in the same spot and seem like they are replacing each other it seems okay in use, I think.  It also has the advantage of getting out of the way when the record has already been save once since you will never see that "Save to Assign" button again.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,924 Points 50k badge 2x thumb
Yes, the parent record doers need to exist for you to be able to record the Focus Record ID#.