# How to create a relation which compares with multiple columns in other sheet

**URL:** <https://community.glideapps.com/t/how-to-create-a-relation-which-compares-with-multiple-columns-in-other-sheet/2592>\
**Category:** Ask for Help\
**Created:** [December 3, 2019, 8:57am UTC](https://community.glideapps.com/t/how-to-create-a-relation-which-compares-with-multiple-columns-in-other-sheet/2592 "2019-12-03T08:57:54Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sidney\_Kunst](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sidney_kunst/32/603_2.png) [@Sidney\_Kunst](https://community.glideapps.com/u/Sidney_Kunst)\
**Post date:** [December 3, 2019, 8:57am UTC](https://community.glideapps.com/t/how-to-create-a-relation-which-compares-with-multiple-columns-in-other-sheet/2592/1 "2019-12-03T08:57:54Z")

</div>

I need to solve this:

Sheet A (games) has 2 Columns with, **“Home team ID”** and **“Away Team ID”**

Sheet B (Teams) has a column with “ID of the team”

I want to relate Teams to the games their in in ONE list. So I need relate Teams to 2 colums of Games which both can contain the team ID.

Does anyone know a fix? Having a new sheet with a beast of an array-kind-of-formula is also good if this fixes it XD

 ![SmartSelect_20191203-113718_Sheets](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/4/4a21b0544ffd3beb3ddee66981e402980eece7d5.jpeg)

To

![SmartSelect_20191203-113729_Sheets](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/d/d15caef04e03d6158d757a92843bc96bc51cb81e.jpeg)

---

<div class="post-metadata">

**Author:** ![George\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george_b/32/534_2.png) [@George\_B](https://community.glideapps.com/u/George_B)\
**Post date:** [December 3, 2019, 12:45pm UTC](https://community.glideapps.com/t/how-to-create-a-relation-which-compares-with-multiple-columns-in-other-sheet/2592/2 "2019-12-03T12:45:23Z")

</div>

Here you go: [https://psman.glideapp.io](https://psman.glideapp.io)

For future consideration it would be great if you would create a spreadsheet with some sample data and share that spreadsheet when you ask the question. This way a responder doesn’t have to create test data and can just answer the question. It took me about the same time to create the spreadsheet as it did to create the relationships and the app. The two relationships were created in Glide in the Data section, not using spreadsheet formulas.

---

<div class="post-metadata">

**Author:** ![Sidney\_Kunst](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sidney_kunst/32/603_2.png) [@Sidney\_Kunst](https://community.glideapps.com/u/Sidney_Kunst)\
**Post date:** [December 3, 2019, 12:52pm UTC](https://community.glideapps.com/t/how-to-create-a-relation-which-compares-with-multiple-columns-in-other-sheet/2592/3 "2019-12-03T12:52:41Z")

</div>

You’re right, should have made some sample stuff! My Apologies!

What you have made is what i have right now. I need to somehow have these 2 inline lists to be just 1 containing all home AND away games (in one inline list 😅)

 ![this](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/4/448e7ff88ca060c22c7d98724eb863863c503960.png)

Any ideas?

---

<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:** [December 3, 2019, 12:55pm UTC](https://community.glideapps.com/t/how-to-create-a-relation-which-compares-with-multiple-columns-in-other-sheet/2592/4 "2019-12-03T12:55:18Z")

</div>

I have a couple thoughts.

1. In your Games sheet create two columns named ‘Team 1’ and ‘Team 2’. This should create an array called ‘Team’. This should allow you to create a relation in the Teams sheet that points to the Teams array in the Games sheet.

2. Just add two relations and two Inline Lists next to each other. It has the appearance of one list.

---

<div class="post-metadata">

**Author:** ![Sidney\_Kunst](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sidney_kunst/32/603_2.png) [@Sidney\_Kunst](https://community.glideapps.com/u/Sidney_Kunst)\
**Post date:** [December 3, 2019, 1:14pm UTC](https://community.glideapps.com/t/how-to-create-a-relation-which-compares-with-multiple-columns-in-other-sheet/2592/5 "2019-12-03T13:14:31Z")

</div>

This is what I already have

 ![Screenshot_20191203-140005_Chrome](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/6/6e479b2447502c391675ab55428efc0091e12677.jpeg)

These are 2 inline lists. For a game related to 2 teams it is good because these will always contain 2 items. Home and away.

BUT when on a team page I want people to see All games in one list (chronologically)

Right nog it looks like this splitted in home and away games ☹

 ![Screenshot_20191203-140102_Chrome](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/5/538d27dedebc7b869ee624cf2e43fe3a7de6faf3.jpeg)

---

<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:** [December 3, 2019, 1:29pm UTC](https://community.glideapps.com/t/how-to-create-a-relation-which-compares-with-multiple-columns-in-other-sheet/2592/6 "2019-12-03T13:29:02Z")

</div>

Did you try my first suggestion? It would give you one list.

---

<div class="post-metadata">

**Author:** ![Sidney\_Kunst](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sidney_kunst/32/603_2.png) [@Sidney\_Kunst](https://community.glideapps.com/u/Sidney_Kunst)\
**Post date:** [December 3, 2019, 1:33pm UTC](https://community.glideapps.com/t/how-to-create-a-relation-which-compares-with-multiple-columns-in-other-sheet/2592/7 "2019-12-03T13:33:35Z")

</div>

What do you mean with. “This should create an array called ‘Team’.”

---

<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:** [December 3, 2019, 1:35pm UTC](https://community.glideapps.com/t/how-to-create-a-relation-which-compares-with-multiple-columns-in-other-sheet/2592/8 "2019-12-03T13:35:23Z")

</div>

Sequentially numbering column headings creates an array. This allows all columns to be treated as one column.

---

<div class="post-metadata">

**Author:** ![Sidney\_Kunst](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sidney_kunst/32/603_2.png) [@Sidney\_Kunst](https://community.glideapps.com/u/Sidney_Kunst)\
**Post date:** [December 3, 2019, 1:44pm UTC](https://community.glideapps.com/t/how-to-create-a-relation-which-compares-with-multiple-columns-in-other-sheet/2592/9 "2019-12-03T13:44:45Z")

</div>

Whoah this works! The “array” looks like this. (While in the spreadsheet it is 2 columns “Team 1” and “Team 2”)

I KNEW it was possible because glide is powerfull💪🏽

Thanks Jeff! Did not find this anywhere (I looked XD)

 ![15753804700925814981695746887460](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/1/11ae1e9c24192965677711e3acf049ee8f492fc9.jpeg)

---

<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:** [December 3, 2019, 2:08pm UTC](https://community.glideapps.com/t/how-to-create-a-relation-which-compares-with-multiple-columns-in-other-sheet/2592/10 "2019-12-03T14:08:51Z")

</div>

Good deal! Yeah, I don’t think all the potential uses with arrays are documented. There might be some documentation when using them with images for the image carousel or using them for an array of emails for per user data. As far as relations, you should be able to do the opposite direction as well, where you could create a relation using the Team column in the games sheet to link to the Teams sheet. I’m sure there’s other potential cases for arrays that I haven’t discovered yet, or have forgotten.

---

<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:** [May 19, 2024, 4:10am UTC](https://community.glideapps.com/t/how-to-create-a-relation-which-compares-with-multiple-columns-in-other-sheet/2592/11 "2024-05-19T04:10:20Z")

</div>


