# Many-to-many Relations

**URL:** https://community.glideapps.com/t/many-to-many-relations/76753
**Category:** Ask for Help
**Created:** [October 2, 2024, 10:36am UTC](https://community.glideapps.com/t/many-to-many-relations/76753 "2024-10-02T10:36:08Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![wfmills](https://avatars.discourse-cdn.com/v4/letter/w/db5fbb/32.png) [@wfmills](https://community.glideapps.com/u/wfmills)
#### Post date: [October 2, 2024, 10:36am UTC](https://community.glideapps.com/t/many-to-many-relations/76753/1 "2024-10-02T10:36:08Z")

</div>

Hi there. I am very new to Glide and have watched several videos online to get going. I am building an app to keep track of sports teams and results. So I have one table with all the players names in it, and one table with all the team names in it. The relationships need to be “many-to-many” so each player can be in more than 1 team, and each team obviously would have more that 1 player in it. I am not sure how to do this as all the videos I have watched show a “1-to-many” or “many-to-1” relation

---

<div class="post-metadata">

### Author: ![Sekayi\_Liburd](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sekayi_liburd/32/77608_2.png) [@Sekayi\_Liburd](https://community.glideapps.com/u/Sekayi_Liburd)
#### Post date: [October 2, 2024, 11:56am UTC](https://community.glideapps.com/t/many-to-many-relations/76753/2 "2024-10-02T11:56:36Z")

</div>

hi mills, add relation columns in both tables and select “match multiple”

---

<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: [October 2, 2024, 11:55pm UTC](https://community.glideapps.com/t/many-to-many-relations/76753/3 "2024-10-02T23:55:10Z")

</div>

You should choose to store this type of relation in text form in one table.

If you choose the teams table, have a column to store a comma-delimited lists of player IDs for each team. Split them into an array using the split text column, and relate that to the players table. In the players table, create a multiple relation from the rowID column to the array in the teams table.

If you choose the players table, have a column to store a comma-delimited lists of team IDs for each player. Split them into an array using the split text column, and relate that to the teams table. In the teams table, create a multiple relation from the rowID column to the array in the players table.

---

<div class="post-metadata">

### Author: ![Sekayi\_Liburd](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sekayi_liburd/32/77608_2.png) [@Sekayi\_Liburd](https://community.glideapps.com/u/Sekayi_Liburd)
#### Post date: [October 3, 2024, 12:22am UTC](https://community.glideapps.com/t/many-to-many-relations/76753/4 "2024-10-03T00:22:29Z")

</div>

Is it a bad thing to have relation columns in both tables?

---

<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: [October 3, 2024, 12:25am UTC](https://community.glideapps.com/t/many-to-many-relations/76753/5 "2024-10-03T00:25:45Z")

</div>

I think it depends on what he’s trying to do. If I need to display which teams a player belongs to, and which players belong to a team, then I would need relations in both tables.

The key point is the information should only be updated on one side.

---

<div class="post-metadata">

### Author: ![wfmills](https://avatars.discourse-cdn.com/v4/letter/w/db5fbb/32.png) [@wfmills](https://community.glideapps.com/u/wfmills)
#### Post date: [October 3, 2024, 5:44am UTC](https://community.glideapps.com/t/many-to-many-relations/76753/6 "2024-10-03T05:44:19Z")

</div>

Thank you for the reply. I have found a few things that I am trying! Like I said, I’m very new to Glide so will figure it out

---

<div class="post-metadata">

### Author: ![Stuart\_Pembery](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/stuart_pembery/32/80332_2.png) [@Stuart\_Pembery](https://community.glideapps.com/u/Stuart_Pembery)
#### Post date: [October 3, 2024, 8:49am UTC](https://community.glideapps.com/t/many-to-many-relations/76753/7 "2024-10-03T08:49:43Z")

</div>

I’ve done this. How can I filter a view of my many-to-many? For example, I would like to click on a player and see a view of which teams they are in?

Thanks

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [October 3, 2024, 10:37am UTC](https://community.glideapps.com/t/many-to-many-relations/76753/8 "2024-10-03T10:37:59Z")

</div>

> [@Hide/show rows in a single collection based on user type](https://community.glideapps.com/t/hide-show-rows-in-a-single-collection-based-on-user-type/76757/10):
>
> You should be able to use a Screen Filter. UserEmail is Screen-\>UserEmail

(please avoid cross posting the same thing to multiple threads)

---

<div class="post-metadata">

### Author: ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)
#### Post date: [October 10, 2024, 11:44am UTC](https://community.glideapps.com/t/many-to-many-relations/76753/9 "2024-10-10T11:44:38Z")

</div>

> [@wfmills](#):
>
> I am not sure how to do this as all the videos I have watched show a “1-to-many” or “many-to-1” relation

Welcome to Glide.

My approach to building changes all the time, but for the past few weeks I have decided to stop overthinking many-to-many relations. If there is one, I create a ThingsA↔︎ThingsB join table where I write row IDs of ThingsA and ThingsB, and that table is my relation. As soon as I create the table I create a single relation to the table of ThingsA and a single relation to the table of ThingsB, and back the other way.

I’m discovering aspects about join tables as I go along, and I’m sure I’m oblivious to many of their pitfalls, but the alternative is CSV values in cells and splitting them into arrays and then relating and that rigamarole. It works fine if there are few entities in the application, but it can get complicated quickly (at least to me). Personally I have trouble visualizing how data and tables relate in the first place, and join tables are making it slightly easier.
