# Filtering by one table, showing joined data from another

**URL:** https://community.glideapps.com/t/filtering-by-one-table-showing-joined-data-from-another/58342
**Category:** Ask for Help
**Created:** [February 23, 2023, 4:15am UTC](https://community.glideapps.com/t/filtering-by-one-table-showing-joined-data-from-another/58342 "2023-02-23T04:15:37Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![jb229229](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jb229229/32/54774_2.png) [@jb229229](https://community.glideapps.com/u/jb229229)
#### Post date: [February 23, 2023, 4:15am UTC](https://community.glideapps.com/t/filtering-by-one-table-showing-joined-data-from-another/58342/1 "2023-02-23T04:15:37Z")

</div>

Hello! New to Glide and excited to engage with the community and hopefully eventually give back some 🙂

I have two primary tables:

1. users (name, email, etc.)
2. products (name, description, etc.)

I’ve connected them with a `user_product` table which creates a row each time a user makes an election on a product (e.g., user A said “yes” to product A).

In the screen I’m building, I’m essentially trying to show all of user A’s “yes” election products on a screen, and all the underlying data from the product table.

I’ve tried two routes:

If I start building this screen from the products table, I can’t seem to filter with the user\_product table, and it doesn’t feel right to bring user dimensions into that product table.

If I start with the user\_product table, I can effectively filter for “yes” only products, but the columns I’d like from the product table aren’t available to use. Perhaps I need to bring all the relevant product fields over via relation columns into the user\_product table for this to work? Just feels redundant if the association is already there…

What am I missing??

---

<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: [February 23, 2023, 4:34am UTC](https://community.glideapps.com/t/filtering-by-one-table-showing-joined-data-from-another/58342/2 "2023-02-23T04:34:38Z")

</div>

I think I have an answer for you, but I’d like to be able to better visualise what you have first.  
Would you mind adding a screen shot of each table?

---

<div class="post-metadata">

### Author: ![jb229229](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jb229229/32/54774_2.png) [@jb229229](https://community.glideapps.com/u/jb229229)
#### Post date: [February 23, 2023, 2:03pm UTC](https://community.glideapps.com/t/filtering-by-one-table-showing-joined-data-from-another/58342/4 "2023-02-23T14:03:11Z")

</div>

User table (pretty basic):

 ![user](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/6/06bd80adecff5b7bf2a6abb0d9c67550fa5d65ed.png)

---

<div class="post-metadata">

### Author: ![jb229229](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jb229229/32/54774_2.png) [@jb229229](https://community.glideapps.com/u/jb229229)
#### Post date: [February 23, 2023, 2:03pm UTC](https://community.glideapps.com/t/filtering-by-one-table-showing-joined-data-from-another/58342/5 "2023-02-23T14:03:43Z")

</div>

user\_product table (where the user makes an election about a product):

 ![user_product](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/2/22ffdef6f49fba6881e022eaf21a6a62b6aa0cee.png)

---

<div class="post-metadata">

### Author: ![jb229229](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jb229229/32/54774_2.png) [@jb229229](https://community.glideapps.com/u/jb229229)
#### Post date: [February 23, 2023, 2:05pm UTC](https://community.glideapps.com/t/filtering-by-one-table-showing-joined-data-from-another/58342/6 "2023-02-23T14:05:48Z")

</div>

product table (also pretty basic):

![Screen Shot 2023-02-23 at 8.05.07 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/2/c20f2fe7951b1219f94c9f810b7dae83f2120bf9.png)

---

<div class="post-metadata">

### Author: ![jb229229](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jb229229/32/54774_2.png) [@jb229229](https://community.glideapps.com/u/jb229229)
#### Post date: [February 23, 2023, 2:07pm UTC](https://community.glideapps.com/t/filtering-by-one-table-showing-joined-data-from-another/58342/7 "2023-02-23T14:07:31Z")

</div>

@Darren_Murphy thanks, see above! So I’m trying to get a page of product columns that I can filter based on which products the user (josh) accepted (election column).

---

<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: [February 23, 2023, 2:20pm UTC](https://community.glideapps.com/t/filtering-by-one-table-showing-joined-data-from-another/58342/8 "2023-02-23T14:20:40Z")

</div>

yep, no problem.

Firstly, I have a couple of suggestions.

- Add a RowD column to your Users table, and use that as a UserID
- Add a RowID column to your Products table, and use that as a ProductID
- In your UserProduct table, instead of storing User Name & Product Name, store the respective ID values for each.

Taking the above approach will make for a much more robust solution, which wont be subject to breakage if/when User or Product names are changed.

Now, to the challenge at hand:

> [@jb229229](#):
>
> If I start with the user\_product table, I can effectively filter for “yes” only products, but the columns I’d like from the product table aren’t available to use. Perhaps I need to bring all the relevant product fields over via relation columns into the user\_product table for this to work? Just feels redundant if the association is already there…

I think what you are looking for here is something we refer to as Inline Lookups, which unfortunately aren’t available in Glide (a long standing feature request, but that’s a separate story).  
So yes, essentially what you need to do is create relations to link the tables - as I can see you’ve already started doing - and then use lookup columns to bring in any related data that you need.  
This might feel like data redundancy, but it isn’t really. These are computed columns that cost nothing - there still remains a single source of truth in each of the respective tables.

> [@jb229229](#):
>
> So I’m trying to get a page of product columns that I can filter based on which products the user (josh) accepted (election column).

Many different ways you can approach this. Can we assume that the user (Josh) will be the currently signed in user, or could it be any user that has been selected from a list of users?

Yes, I know I haven’t given you a direct answer yet, but I’m working my way to it 😉

---

<div class="post-metadata">

### Author: ![jb229229](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jb229229/32/54774_2.png) [@jb229229](https://community.glideapps.com/u/jb229229)
#### Post date: [February 24, 2023, 2:32am UTC](https://community.glideapps.com/t/filtering-by-one-table-showing-joined-data-from-another/58342/9 "2023-02-24T02:32:43Z")

</div>

Yes fair to assume Josh will be signed in user, good question!

---

<div class="post-metadata">

### Author: ![jb229229](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jb229229/32/54774_2.png) [@jb229229](https://community.glideapps.com/u/jb229229)
#### Post date: [February 25, 2023, 10:25pm UTC](https://community.glideapps.com/t/filtering-by-one-table-showing-joined-data-from-another/58342/10 "2023-02-25T22:25:46Z")

</div>

@Darren_Murphy I think it actually works well when I put more product columns into the user\_product table like you suggested. Then I can base the whole page/tab on that user\_product table and can thus leverage the filtering columns I need. I think I’m good?! Thanks again. I’m sure I’ll have another question in a matter of hours here 🙂

---

<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: [February 26, 2023, 4:42am UTC](https://community.glideapps.com/t/filtering-by-one-table-showing-joined-data-from-another/58342/11 "2023-02-26T04:42:56Z")

</div>

oh, I’m sorry - I forgot that I owed you a reply.  
Things can get a bit lost sometimes…

> [@jb229229](#):
>
> Then I can base the whole page/tab on that user\_product table and can thus leverage the filtering columns I need. I think I’m good?!

yep, that should be fine
