Related Posts
What Are Parent-Child Records?
Hi, I’m Ro, and today I’m going to show you how to display parent-child records in your live app. This will help make it easier to show multiple connected records associated with a single record.
So, what do we mean by showing a parent-child record in your live app?
We’re referring to having one parent record that connects to many child records—and then combining them in one view. Some good examples include:
- A company that has many contacts
- A customer that has many orders
- A project that has many tasks
In your workflow or dashboard, you may want to show a list of companies and then drill down to view a single company record—along with more details about that company.
Understanding the Goal
This includes those child records or any records associated with the company via a connection field. In other words, we may want to see a company and its contact records on a single page.
Enough talk—let’s jump into a quick demo. Before we dive in, this might be a good time to pause the video and make sure you understand how to add objects and connections to your application.
We have some great guides in our Knowledge Base. You can search for “objects” or “connections” and review those resources.
Quick Demo: How It Works
In our example, we have a table of companies. We want to drill down and just look at this first company and see the contacts associated with it.
Now, we can see the company details—and below that, the connected contacts. We can also add a new contact if we want to.
Step-by-Step: Building the Page
Let’s get started with the build.
I’m heading into the builder. Again, make sure you know how to add objects and connection fields—our Knowledge Base has a great article on this.
Step 1: Check Your Objects
Make sure we have the “Companies” object and the “Contacts” object. In the Contacts object, there’s a connection field that links each contact to a company. So whenever we add a contact, we can associate it with a company.
Step 2: Add a New Page
Now we’ll head over to the Pages section. We’ll add a brand-new page—let’s call it “Company Manager.”
Once the page is created, the next step is to add views.
Adding Views to Show the Parent and Child Records
Step 1: Add a Table of Companies
We’ll first add a dashboard view that shows all the companies in our database. By default, a few fields will be selected.
This table lets us see all the companies.
Step 2: Add Links to View Details
Next, we want to add links that allow users to view more details about each company.
On that new page, we’ll add more views—these are the child records we talked about.
Step 3: Add Child Record Views
We’ll start with a details view of the company at the top. Then we’ll add a table view of contacts connected to that company.
Finally, we’ll add a form on the page—not to edit the company, but to add a new connected contact.
Whenever we add a new contact using that form, it will automatically be linked to that company and appear on the details page.
Viewing It in the Live App
Once we finish the setup:
- We can click the company name to view its details.
- The page shows the company’s info, a table of connected contacts, and a form to add more.
This is how we bring parent-child relationships together on one page using Knack.
Adding Views Later (Optional)
You can also add these views after the page has already been created.
Let’s say we didn’t add the contact table earlier—we can still do that by clicking Add View > Table.
Knack will ask which contact records to show. Choose the ones connected to the page’s company.
You can also add additional links or view types here.
Wrap-Up and Support
Hopefully, this helps!
We also have a how-to guide in our Knowledge Base—you can find the link in the description section of this video.
Let us know if you have any questions or if there are other how-to videos you’d like to see.
You can reach us at support@knack.com.
Cheers.