# Relations between many-many fields

**URL:** <https://community.glideapps.com/t/relations-between-many-many-fields/82470>\
**Category:** Ask for Help\
**Created:** [June 13, 2025, 4:12pm UTC](https://community.glideapps.com/t/relations-between-many-many-fields/82470 "2025-06-13T16:12:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paarl\_Bus](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/paarl_bus/32/84589_2.png) [@Paarl\_Bus](https://community.glideapps.com/u/Paarl_Bus)\
**Post date:** [June 13, 2025, 4:12pm UTC](https://community.glideapps.com/t/relations-between-many-many-fields/82470/1 "2025-06-13T16:12:34Z")

</div>

Hi everyone. Started using Glide yesterday after many failed efforts with other database apps. I imported my Google Sheets data (via Excel download) and started with Layouts to see what it does. Easy! Except for one incomprehensible problem.

I manage bookings for a small charter company that transports school children between schools and home towns on weekends. I have tables for Parents, Children, Schools, Hostels (where kids board and are picked up & dropped), etc. I needed to create Layouts for Parents with Children, Children with Parents, Schools with Hostels and so on. Schools was easy, once I remembered to add a Relation field for Hostels to Schools. But Parents/Children are many-to-many and here is a snag. I use a join table to handle the relationships. It consists simply of a ParentID field and a ChildID field. I added the Relation for Parents to the Children table (Join ChildID in Children with ChildID in ParentChild) and it shows both parents (where applicable) correctly. But the Relation field in Parents (on ParentID) shows the parent name. If the child has 2 parents in the database it shows the first one twice.  
I included 3 partial screenshots, incl. one of the Schools form that shows the correct hostels below.

 ![Kids with Parents](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/f/bfbea696afbab81fef7da574ce8091ec3bce1d67.png)  
 ![Parents with kids](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/4/74b050deccc9699b194a4e66c50455f00e4e5868.png)  
 ![Schools Layout with hostels](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/9/5958dc1b7828ac99287cd07b03928515361bd5d7.png)

---

<div class="post-metadata">

**Author:** ![Mazen](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mazen/32/84042_2.png) [@Mazen](https://community.glideapps.com/u/Mazen)\
**Post date:** [June 13, 2025, 4:18pm UTC](https://community.glideapps.com/t/relations-between-many-many-fields/82470/2 "2025-06-13T16:18:38Z")

</div>

Hey Paarl, Welcome to Glide community!  
You’re really close! The problem is just in how the relation is set up through your join table.

Here’s a quick fix:

1. **In the Children table:**

- Create a **multiple relation** from `ChildID` → `ChildID` in your `ParentChild` table.
- Then add a **lookup** to get the `ParentIDs` from that relation.
- Finally, create another relation from those `ParentIDs` to your `Parents` table.

This gives you the correct list of parents for each child, no duplicates.

1. **Do the same in reverse** for Parents → Children using `ParentID`.

Glide doesn’t follow many-to-many links directly, so you have to go:  
**Child → ParentChild → Parent**  
**Parent → ParentChild → Child**

---

<div class="post-metadata">

**Author:** ![Paarl\_Bus](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/paarl_bus/32/84589_2.png) [@Paarl\_Bus](https://community.glideapps.com/u/Paarl_Bus)\
**Post date:** [June 13, 2025, 4:44pm UTC](https://community.glideapps.com/t/relations-between-many-many-fields/82470/3 "2025-06-13T16:44:56Z")

</div>

Good Lord, that was easy! Thank you so much Mazen for your clear instructions.  
The reason the Children table showed the correct parents was that my ParentChild table had 2 additional columns I added later, for child’s name and parent’s name. The paren’ts name  
was adjacent to the ChildID column and somehow Glide got hold of that data…  
Regards  
Herman

---

<div class="post-metadata">

**Author:** ![Mazen](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mazen/32/84042_2.png) [@Mazen](https://community.glideapps.com/u/Mazen)\
**Post date:** [June 13, 2025, 5:05pm UTC](https://community.glideapps.com/t/relations-between-many-many-fields/82470/4 "2025-06-13T17:05:10Z")

</div>

Glad to hear that u made it! You’re welcome pal

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 13, 2025, 10:40pm UTC](https://community.glideapps.com/t/relations-between-many-many-fields/82470/5 "2025-06-13T22:40:45Z")

</div>

> [@Paarl\_Bus](#):
>
> The paren’ts name  
> was adjacent to the ChildID column and somehow Glide got hold of that data…

Do you mean the name shows in the relation? If it’s the case, what shows there is merely a sign of a relation being established.

People have misunderstood the field that is shown on the relation before, so thought I should clarify.

---

<div class="post-metadata">

**Author:** ![Paarl\_Bus](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/paarl_bus/32/84589_2.png) [@Paarl\_Bus](https://community.glideapps.com/u/Paarl_Bus)\
**Post date:** [June 14, 2025, 4:33am UTC](https://community.glideapps.com/t/relations-between-many-many-fields/82470/6 "2025-06-14T04:33:05Z")

</div>

Yes, if you look at the screenshot of Parents and Children you’ll see names displayed in the most right hand column. The relation field should show the IDs for the related field, right?  
Thanks for clarifying.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 14, 2025, 4:40am UTC](https://community.glideapps.com/t/relations-between-many-many-fields/82470/7 "2025-06-14T04:40:12Z")

</div>

> [@Paarl\_Bus](#):
>
> The relation field should show the IDs for the related field, right?

It’s merely a way Glide shows you that yeah, we got this relation and here’s 1 field from it.

If you need to get back an actual field for display, you use a lookup/joined list on top of the relation.

---

<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:** [June 21, 2025, 4:40am UTC](https://community.glideapps.com/t/relations-between-many-many-fields/82470/8 "2025-06-21T04:40:57Z")

</div>

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