# Child database based on 2 parents

**URL:** <https://community.glideapps.com/t/child-database-based-on-2-parents/75016>\
**Category:** Ask for Help\
**Created:** [July 19, 2024, 11:59am UTC](https://community.glideapps.com/t/child-database-based-on-2-parents/75016 "2024-07-19T11:59:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![scotfield123](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/scotfield123/32/62356_2.png) [@scotfield123](https://community.glideapps.com/u/scotfield123)\
**Post date:** [July 19, 2024, 11:59am UTC](https://community.glideapps.com/t/child-database-based-on-2-parents/75016/1 "2024-07-19T11:59:56Z")

</div>

Hi guys,  
I’m sure is a simple fix but at the moment my brain stopped working. I know how to do a relation between a parent and a child. I need the child database to relate based on 2 parent databases.  
i have 3 databases:

 ![Cranes](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/9/d9a0d7dda5a41e099b88facd44281058be666e9d.png)  
 ![Pages](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/1/2157c62525606f8a3e3ea2586202390781df6ed8.png)  
 ![Projects](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/4/1432b831bf22cba7f1459c2df05196dc585c2e3d.png)

So in the tab Cranes i need to see the cranes from that specific Project, it shows me all the cranes from all the projects.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [July 19, 2024, 12:24pm UTC](https://community.glideapps.com/t/child-database-based-on-2-parents/75016/2 "2024-07-19T12:24:09Z")

</div>

Can you clarify which columns need to be related to what in each of the three tables you are showing? I’m guessing you need a Query column, but I’m not clear on what you are looking for.

---

<div class="post-metadata">

**Author:** ![scotfield123](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/scotfield123/32/62356_2.png) [@scotfield123](https://community.glideapps.com/u/scotfield123)\
**Post date:** [July 19, 2024, 12:40pm UTC](https://community.glideapps.com/t/child-database-based-on-2-parents/75016/3 "2024-07-19T12:40:06Z")

</div>

![site](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/9/b9d833bc1c774eb1b52d4f457b0ed6e9b399f075.png)  
Each Project tab to contain a Crane tab and each Crane tab to have the Crane/Cranes for that specific Project

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [July 19, 2024, 1:19pm UTC](https://community.glideapps.com/t/child-database-based-on-2-parents/75016/4 "2024-07-19T13:19:31Z")

</div>

I think your use of the word tab is throwing me off, so forgive me if I’m misunderstanding anything. Tabs are the the different tab screens on the front end of the app. What you are showing are tables. Tables contain row and columns. Plus, I can’t see all of your table names, so I’m trying to determine what is what.

Anyway, I assume this latest screenshot is coming from the table you are showing in your first screenshot? Based on your first three screenshots, are you trying to connect the first table to the second table by linking both project and pages?

---

<div class="post-metadata">

**Author:** ![scotfield123](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/scotfield123/32/62356_2.png) [@scotfield123](https://community.glideapps.com/u/scotfield123)\
**Post date:** [July 19, 2024, 1:39pm UTC](https://community.glideapps.com/t/child-database-based-on-2-parents/75016/5 "2024-07-19T13:39:39Z")

</div>

Sorry that I’m not able to explain properly and thank you for your help.  
I need to have a list of Projects, each of them to have a list of pages and each of them pages to have a list of elements specific for that project. Forget about them tables. I’ve made an app for the project I’m working in. I need to make the app available for multipel projects so I’m working on app’s structure.

something like this

 ![aaaa](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/5/65b32b32a262f8e54c3abf9f248eec2f9ec492c1.png)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [July 19, 2024, 2:14pm UTC](https://community.glideapps.com/t/child-database-based-on-2-parents/75016/6 "2024-07-19T14:14:00Z")

</div>

OK. I think I’m following the hierarchy now.

So what I would do is create a Relation column in the Project table linking the project name to the project name in the Pages table. Not sure if you need it, but you could also create a Relation column linking the project name to the project name in the Cranes table.

In the Pages table, create a Query column that links the project name and page name to the project name and page name in the Cranes table.

That way, when you build your screens, you can first show alist of projects. When you go to the details screen for a project, add a collection sourced from the relation column in the Projects table. When you click on a specific page to view it’s details in that collection, add another collection sourced from the query column in the Pages table. That should ultimately show just the Cranes for the selected Project and Page.

---

<div class="post-metadata">

**Author:** ![scotfield123](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/scotfield123/32/62356_2.png) [@scotfield123](https://community.glideapps.com/u/scotfield123)\
**Post date:** [July 19, 2024, 2:40pm UTC](https://community.glideapps.com/t/child-database-based-on-2-parents/75016/7 "2024-07-19T14:40:03Z")

</div>

> [@Jeff\_Hager](#):
>
> In the Pages table, create a Query column that links the project name and page name to the project name and page name in the Cranes table.

Thank you for your help, so far so good. How can I do that in a query column?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [July 19, 2024, 2:52pm UTC](https://community.glideapps.com/t/child-database-based-on-2-parents/75016/8 "2024-07-19T14:52:53Z")

</div>

> **[Query Column | Glide Docs](https://www.glideapps.com/docs/automation/computed-columns/query-column)**
>
> Create complex relations in your data with conditional filtering, sorting, and limits.

---

<div class="post-metadata">

**Author:** ![scotfield123](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/scotfield123/32/62356_2.png) [@scotfield123](https://community.glideapps.com/u/scotfield123)\
**Post date:** [July 19, 2024, 3:03pm UTC](https://community.glideapps.com/t/child-database-based-on-2-parents/75016/9 "2024-07-19T15:03:34Z")

</div>

thank you, you are a star 😍

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [July 26, 2024, 3:25pm UTC](https://community.glideapps.com/t/child-database-based-on-2-parents/75016/11 "2024-07-26T15:25:04Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
