# Many to many relationships

**URL:** <https://community.glideapps.com/t/many-to-many-relationships/21584>\
**Category:** Ask for Help\
**Created:** [January 22, 2021, 6:48pm UTC](https://community.glideapps.com/t/many-to-many-relationships/21584 "2021-01-22T18:48:52Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![timheuer](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/timheuer/32/20153_2.png) [@timheuer](https://community.glideapps.com/u/timheuer)\
**Post date:** [January 22, 2021, 6:48pm UTC](https://community.glideapps.com/t/many-to-many-relationships/21584/1 "2021-01-22T18:48:52Z")

</div>

I’m struggling with many-to-many here. My goal is

- have a list of members
- have a list of possible events
- members can choose which events they are going to
- on the app show an event and who is attending that

I saw this post referencing 3 sheets [Many-to-Many Relationships - #22 by Alfonso\_Aguilar](https://community.glideapps.com/t/many-to-many-relationships/2225/22) but the sample is not there anymore.

Something isn’t clicking for me even after watching all the videos on relationships in Glide.

---

<div class="post-metadata">

**Author:** ![Rosewebstudio](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rosewebstudio/32/12261_2.png) [@Rosewebstudio](https://community.glideapps.com/u/Rosewebstudio)\
**Post date:** [January 22, 2021, 8:00pm UTC](https://community.glideapps.com/t/many-to-many-relationships/21584/2 "2021-01-22T20:00:38Z")

</div>

Hi @timheuer

I know you said you have watched videos, just checking that you have seen this one?

[![](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/c/8cd6216f29c5db22cecd7760e1347c5fe8496b0b.jpeg "Multiple Relations | Glide Tutorial") ](https://www.youtube.com/watch?v=0QGbNsAPhLw)

And read this

> **[Glide • Quickstart](https://www.glideapps.com/docs)**
>
> Publish your first app in under 5 minutes

---

<div class="post-metadata">

**Author:** ![timheuer](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/timheuer/32/20153_2.png) [@timheuer](https://community.glideapps.com/u/timheuer)\
**Post date:** [January 22, 2021, 8:35pm UTC](https://community.glideapps.com/t/many-to-many-relationships/21584/3 "2021-01-22T20:35:13Z")

</div>

Yes unfortunately those are not helping me…I’m clearly missing something in my brain.

In a normal database I’d have 3 tables: members, events, memberevents – I’m just not seeing how 3 sheets then map using this relational column concept _and_ still show me the values i want

---

<div class="post-metadata">

**Author:** ![Alfonso\_Aguilar](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/alfonso_aguilar/32/3833_2.png) [@Alfonso\_Aguilar](https://community.glideapps.com/u/Alfonso_Aguilar)\
**Post date:** [January 22, 2021, 8:51pm UTC](https://community.glideapps.com/t/many-to-many-relationships/21584/4 "2021-01-22T20:51:59Z")

</div>

Hi @timheuer.

It was a long time ago and some current features were not available then… Here is a link to the sample app: [https://many2many-norep.glideapp.io](https://many2many-norep.glideapp.io).

Take a look to the data tables in the app. You will find 3 tables:

> 1. Events table: you list of possible events.
> 2. Participants table: your list of members.
> 3. Attendees table: your list of “memberevents". When a member chooses to go to an event, you create a row in this table.

Instead of creating a "many-to-many” relation between Events and Participants, you should create 2 “one-to-many” relations:

> 1. Events(1)-to-Attendees(many): one event can have relate to many member-event pairs (or have many participants).
> 2. Participants(1)-to-Attendees(many): one member can relate to many member-event pairs (or "be an attendee” to many events).

When a member chooses to attend an event, you just need to create a new member-event pair in the Attendees table. You can traverse the relations to grab data from the related tables using LookUp columns.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![timheuer](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/timheuer/32/20153_2.png) [@timheuer](https://community.glideapps.com/u/timheuer)\
**Post date:** [January 22, 2021, 11:22pm UTC](https://community.glideapps.com/t/many-to-many-relationships/21584/5 "2021-01-22T23:22:45Z")

</div>

Thanks @Alfonso_Aguilar this is helpful to look at – I’ve made more progress. Now trying to display the right things on the form is hard:

Done - I want a Member screen that shows the name of all events they are getting  
Done - A list of events  
Not figured out - Look at the event details and show a list of names that are registered (not the unique key) and allow link to the details of that member

---

<div class="post-metadata">

**Author:** ![Alfonso\_Aguilar](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/alfonso_aguilar/32/3833_2.png) [@Alfonso\_Aguilar](https://community.glideapps.com/u/Alfonso_Aguilar)\
**Post date:** [January 23, 2021, 1:33am UTC](https://community.glideapps.com/t/many-to-many-relationships/21584/6 "2021-01-23T01:33:39Z")

</div>

You can use a LookUp column.

Notice that to reach the Participants table from the Events table you have to traverse 2 relations: Events-to-Attendees and Attendees-to-Participants. For your reference,I have added a new LookUp column to the Events table in the sample app. You may need to get an updated copy of the app (link: [https://many2many-norep.glideapp.io/](https://many2many-norep.glideapp.io/)).

Please, have a look at it and try to do the same in your app:

> Step 1. In your Events data table, create a LookUp column and configure it to reach into the Participants table through the necessary relations (Events-to-Attendees \> Attendees-to-Participants).  
> Step 2. In your Events layout, select the LookUp column created in Step 1 as the source for the values in the list of attendees.  
> Step 3. You should now see and be able to use Participants data to populate list entries.  
> Step 4. By default, tapping on any entry in the list will show the Participant details (you can change this by selecting a different action in the list Features tab).

Good luck!

---

<div class="post-metadata">

**Author:** ![kcrane](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kcrane/32/62929_2.png) [@kcrane](https://community.glideapps.com/u/kcrane)\
**Post date:** [August 20, 2023, 8:55pm UTC](https://community.glideapps.com/t/many-to-many-relationships/21584/7 "2023-08-20T20:55:22Z")

</div>

This worked for me… but whoo I wasn’t going to come up with that for myself.  
I had exactly the problem of two hops to get past the linking table, I didn’t think of doing the hops in the data tables 😀

---

<div class="post-metadata">

**Author:** ![SomeKidNamedAlex](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/somekidnamedalex/32/66371_2.png) [@SomeKidNamedAlex](https://community.glideapps.com/u/SomeKidNamedAlex)\
**Post date:** [November 13, 2023, 5:49am UTC](https://community.glideapps.com/t/many-to-many-relationships/21584/8 "2023-11-13T05:49:44Z")

</div>

Hey All,

After a little experimentation I figured out a method for a natively supported many-to-many relation without using a linking table.

There is a calculated column type called “Split Text” that makes the magic happen!

Here’s my methodology:

1. Create a choice UX element on table A which allows you to select multiple items from table B storing those table B IDs as comma separated text on table A.
2. Create a “Split Text” column on table A which reads your table B IDs and splits them into an array of multiple text objects each with a relevant table B ID
3. Create a relation between table A and table B linking on the split text column
4. When displaying objects from the related table (A-\>B OR B-\>A) use a “contained in” or “contains” filter to check for all not just one object.

Bonus) If you’d like to display this list of related objects in context, create a “Joined List” object to concatenate the relevant text into a single text field and display it as a single field.

Honestly It’s beautiful. Thank you Glide team for the split text column type!  
-AVF

---

<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:** [November 13, 2023, 11:51pm UTC](https://community.glideapps.com/t/many-to-many-relationships/21584/9 "2023-11-13T23:51:25Z")

</div>

> [@SomeKidNamedAlex](#):
>
> use a “contained in” or “contains” filter to check for all not just one object.

If you have relations already, why do you need to use contain though?

---

<div class="post-metadata">

**Author:** ![Lenox\_Ramsey\_Jr](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lenox_ramsey_jr/32/69621_2.png) [@Lenox\_Ramsey\_Jr](https://community.glideapps.com/u/Lenox_Ramsey_Jr)\
**Post date:** [January 21, 2024, 4:35am UTC](https://community.glideapps.com/t/many-to-many-relationships/21584/10 "2024-01-21T04:35:46Z")

</div>

Here’s a use case question, what happens in the case where you have teams with members with each member have different roles (ie. admin, manager, etc), how does that work?

In a normal database, you would create teams, members, team\_members so it sounds like that would be different in Glide, is that correct?

---

<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:** [January 21, 2024, 5:27am UTC](https://community.glideapps.com/t/many-to-many-relationships/21584/11 "2024-01-21T05:27:03Z")

</div>

Are you looking for something related to relations, or are you actually looking for Roles?

> **[Roles | Glide Docs](https://www.glideapps.com/docs/essentials/security-and-user-data/roles)**
>
> Define roles for your users and build different experiences and permissions.
