# Dynamic filtering of multiple items

**URL:** <https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196>\
**Category:** Ask for Help\
**Created:** [March 31, 2024, 9:00pm UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196 "2024-03-31T21:00:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![hirereach](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hirereach/32/58130_2.png) [@hirereach](https://community.glideapps.com/u/hirereach)\
**Post date:** [March 31, 2024, 9:00pm UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/1 "2024-03-31T21:00:23Z")

</div>

Is it possible to build dynamic filtering of multiple items? Here’s what I mean (example):

**Reviews from companies you follow**  
_(Step 1 is all reviews for 1 company. Step 2 is all reviews for 2+ companies)_

**1/ List reviews for [Company A] from all companies:**

21 reviews for [Company A] from [Company B]  
12 reviews for [Company A] from [Company C]  
3 reviews for [Company A] from [Company D]

**2/ List multiple [Company] reviews from all companies**

21 reviews for [Company A] from [Company B]  
12 reviews for [Company A] from [Company C]  
3 reviews for [Company A] from [Company D]

13 reviews for [Company B] from [Company A]  
2 reviews for [Company B] from [Company C]  
5 reviews for [Company B] from [Company D]

I’m finding this really hard to do because there are multiple dynamic variables.

---

<div class="post-metadata">

**Author:** ![etienneduper](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/etienneduper/32/67963_2.png) [@etienneduper](https://community.glideapps.com/u/etienneduper)\
**Post date:** [March 31, 2024, 9:26pm UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/2 "2024-03-31T21:26:52Z")

</div>

Can you share what your tables look like ? Do you have one table for all reviews or the reviews are directly in your company table ?

---

<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:** [March 31, 2024, 11:15pm UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/3 "2024-03-31T23:15:09Z")

</div>

I think you can do this with a little creativity in grouping items in a collection (assuming you need the grouping text to say just like what you lined out in your post).

Create a query column in your reviews table, and filter by reviewer company is this row \> reviewer company, and reviewed company is this row \> reviewed company. A rollup over that query would give you the total count.

Then construct your pluralized column (1 =\> 1 review, others =\> X reviews).

Finally a template so that we get X review/reviews for … from …

Add a collection and allow filtering by the reviewed company, and group by the template above.

---

<div class="post-metadata">

**Author:** ![hirereach](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hirereach/32/58130_2.png) [@hirereach](https://community.glideapps.com/u/hirereach)\
**Post date:** [April 1, 2024, 8:02pm UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/4 "2024-04-01T20:02:10Z")

</div>

Thank you, super helpful (as always!)

- Sorry, I forgot to say, I want to return this in a text field so I can put it in the Description part of a List. Not sure I can do grouping in the case?

“Create a query column in your reviews table, and filter by reviewer company is this row \> reviewer company, and reviewed company is this row \> reviewed company. A rollup over that query would give you the total count.”

- I’m not sure I clearly understand what you’re describing here. Can you elaborate?

“Finally a template so that we get X review/reviews for … from …”

- I’m also unclear here.

Hardest thing I think for me is getting a row with a) 34 reviews b) beside Company XYZ, then the next row (/n), with a) 6 reviews b) beside Company ABC …instead of having a) all the reviews lumped together (34,6) separately from b) the company names (Company XYZ,Company XYZ). Does that make sense?

I’m finding this one’s maybe tricky to describe!

---

<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:** [April 2, 2024, 1:40am UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/5 "2024-04-02T01:40:36Z")

</div>

> [@hirereach](#):
>
> Sorry, I forgot to say, I want to return this in a text field so I can put it in the Description part of a List. Not sure I can do grouping in the case?

The final result would be in a template field, so you can use it in your list.

> [@hirereach](#):
>
> I’m not sure I clearly understand what you’re describing here. Can you elaborate?

> **[Query Column | Glide Docs](https://www.glideapps.com/docs/automation/computed-columns/query-column)**
>
> Create complex relations in your data with conditional filtering, sorting, and limits.

Please check the query column here.

> [@hirereach](#):
>
> I’m also unclear here.

That’s a template column of something like: X for Y from Z.

Where X is the string you get from the pluralized column.

Y is the reviewed company’s name.

Z is the reviewing company’s name.

> [@hirereach](#):
>
> Hardest thing I think for me is getting a row with a) 34 reviews b) beside Company XYZ, then the next row (/n), with a) 6 reviews b) beside Company ABC …instead of having a) all the reviews lumped together (34,6) separately from b) the company names (Company XYZ,Company XYZ). Does that make sense?

I’m not sure I understand this. Do you have a visual representation of what you want to achieve?

---

<div class="post-metadata">

**Author:** ![hirereach](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hirereach/32/58130_2.png) [@hirereach](https://community.glideapps.com/u/hirereach)\
**Post date:** [April 8, 2024, 7:04pm UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/6 "2024-04-08T19:04:15Z")

</div>

Here’s what I’m trying to do. Does this help?  
(Where a “Person” is an employee of a Company)

 ![Company Follows](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/6/065749b0aa3b2b08986d84d9c8f01d779a86a019.jpeg)

---

<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:** [April 8, 2024, 11:21pm UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/7 "2024-04-08T23:21:37Z")

</div>

I think from the company table, you can get the information you need. Is the reviews table storing the review from and review for on the person-level or the company level?

Say Thinh, from company A, reviews hirereach, from company B, or do you just store a review from company A directly to company B?

---

<div class="post-metadata">

**Author:** ![hirereach](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hirereach/32/58130_2.png) [@hirereach](https://community.glideapps.com/u/hirereach)\
**Post date:** [April 9, 2024, 12:21am UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/8 "2024-04-09T00:21:56Z")

</div>

“Is the reviews table storing the review from and review for on the person-level or the company level?”

At the person level.

“Say Thinh, from company A, reviews hirereach, from company B, or do you just store a review from company A directly to company B?”

No, it’s at the person level.

We could also do which companies have reviewed a person. I just don’t want to reveal the reviewer’s identity, just the company they work at.

---

<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:** [April 9, 2024, 12:25am UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/9 "2024-04-09T00:25:53Z")

</div>

Then I think you can use a relation on the Reviews table to then Lookup the company ID, and then go back to construct it this way?

> [@Dynamic filtering of multiple items](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/3):
>
> I think you can do this with a little creativity in grouping items in a collection (assuming you need the grouping text to say just like what you lined out in your post). Create a query column in your reviews table, and filter by reviewer company is this row \> reviewer company, and reviewed company is this row \> reviewed company. A rollup over that query would give you the total count. Then construct your pluralized column (1 =\> 1 review, others =\> X reviews). Finally a template so that we ge…

---

<div class="post-metadata">

**Author:** ![hirereach](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hirereach/32/58130_2.png) [@hirereach](https://community.glideapps.com/u/hirereach)\
**Post date:** [April 9, 2024, 2:25am UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/10 "2024-04-09T02:25:09Z")

</div>

Sorry, I’m feeling slow on this. I’m trying to catch up on the way glide does things vs airtable. Do you mean something like this?

Reviews → Relation → Company Name  
Or  
Reviews → Lookup → Company RecID  
?

Then how do I get the number of reviews from each followed company beside the company name?

---

<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:** [April 9, 2024, 4:02am UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/11 "2024-04-09T04:02:06Z")

</div>

> [@hirereach](#):
>
> Reviews → Relation → Company Name  
> Or  
> Reviews → Lookup → Company RecID  
> ?

A relation establishes a link between a single row and one or many other rows by matching common values. So in the above case, you need something unique that identifies a Company in your Reviews table (usually a RowID), and then you can use that to create a relation between the two tables.

Important: A relation doesn’t contain any actual data. It’s just a link. That’s where the lookup comes in. Taking the above as an example, imagine that you have a CompanyID in your reviews table, and you need to know the Company Name. What you would do is create a single relation in your Reviews table that matches the Company ID with the same value in your Companies table, and then use a Lookup column to fetch the Company Name via the relation.

> [@hirereach](#):
>
> Then how do I get the number of reviews from each followed company beside the company name?

Create a Query or Multiple Relation column that matches the Company value in the Reviews table, and then use a Rollup column to get a count via the query/relation.

---

<div class="post-metadata">

**Author:** ![hirereach](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hirereach/32/58130_2.png) [@hirereach](https://community.glideapps.com/u/hirereach)\
**Post date:** [April 9, 2024, 2:39pm UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/12 "2024-04-09T14:39:01Z")

</div>

Thank you! Super helpful. Trying this now…

---

<div class="post-metadata">

**Author:** ![hirereach](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hirereach/32/58130_2.png) [@hirereach](https://community.glideapps.com/u/hirereach)\
**Post date:** [April 9, 2024, 8:47pm UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/13 "2024-04-09T20:47:40Z")

</div>

I think that may have done it, except for one thing.

I think I’ve got the “X reviews from Company A” part working, but when I try to break each result into its own line by adding “\n” between results, the line breaks are not working.

I’m using a Joined List field to get all the results into a cell in Glide, but in the Collection Description field that I want to display results in, it’s showing “X reviews from Company A\nY reviews from Company B\nZ reviews from Company C\n” instead of what I want:  
“X reviews from Company A  
Y reviews from Company B  
Z reviews from Company C”

“\n” works in AIrtable but how do I fix this in Glide?

---

<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:** [April 9, 2024, 11:47pm UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/14 "2024-04-09T23:47:50Z")

</div>

Use a “Return” or “Enter” key instead of \n. A carriage return character.

---

<div class="post-metadata">

**Author:** ![hirereach](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hirereach/32/58130_2.png) [@hirereach](https://community.glideapps.com/u/hirereach)\
**Post date:** [April 10, 2024, 4:28pm UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/15 "2024-04-10T16:28:36Z")

</div>

Awesome, that worked. Thank you!

Last(ish) question on this…Now that I have an awesome list with line breaks, how do I add a first/top line to my list that displays some text that I wrote in a different cell?

---

<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:** [April 10, 2024, 5:09pm UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/16 "2024-04-10T17:09:43Z")

</div>

Use a template column.

---

<div class="post-metadata">

**Author:** ![hirereach](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hirereach/32/58130_2.png) [@hirereach](https://community.glideapps.com/u/hirereach)\
**Post date:** [April 12, 2024, 5:31pm UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/17 "2024-04-12T17:31:43Z")

</div>

Thanks for your help, Darren!

---

<div class="post-metadata">

**Author:** ![hirereach](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hirereach/32/58130_2.png) [@hirereach](https://community.glideapps.com/u/hirereach)\
**Post date:** [April 20, 2024, 5:29pm UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/18 "2024-04-20T17:29:02Z")

</div>

Ugh, taking a step back, I’m actually still struggling with my core problem here (I thought I had it solved but I don’t).

Here’s where I’m stuck:

I have a Glide Lookup column named {ReviewFrom} that’s populated with the name of the reviewing company each time they reviewed for that Record/RowID:

- Company ABC, Company XYZ, Company 123, Company ABC

Company ABC is listed twice because it has submitted 2 reviews for that Record/RowID.

I have a Rollup column that counts the total reviews from all companies (4), but that’s not what I want. I want the count per company in a Joined List column (or at least I think that’s the type of column I need to use).

For example (assume I’m using a Template column to connect the company name and Rollup column value), I WANT to list this in the Joined List column:

- “Company ABC 2 reviews”
- “Company XYZ 1 reviews”
- “Company 123 1 reviews”

I do NOT want:

- “Company ABC 4 reviews”
- “Company XYZ 4 reviews”
- “Company 123 4 reviews”

How do I get a column to do this? (Also, what type of 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:** [April 20, 2024, 6:04pm UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/19 "2024-04-20T18:04:03Z")

</div>

You probably need a combination of a query column and a rollup column, but can we take one step further back, and can you show me what your Reviews table looks like?

---

<div class="post-metadata">

**Author:** ![hirereach](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hirereach/32/58130_2.png) [@hirereach](https://community.glideapps.com/u/hirereach)\
**Post date:** [April 20, 2024, 6:47pm UTC](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196/20 "2024-04-20T18:47:13Z")

</div>

Sure, I’ll try to demonstrate vertically here. I’ll start with the Airtable structure:

Reviews-Table columns:

- ReviewFor (linked to People-Table)
- ReviewFrom (linked to People-Table)
- PeopleSessions (linked to PeopleSessions-Table)

People-Table columns:

- Company (linked to Company-Table)
- PeopleSessions (linked to PeopleSessions-Table)
- ReviewsSubmitted (linked to Reviews-Table)
- ReviewsReceived (linked to Reviews-Table)

PeopleSessions-Table columns:

- Person (linked to People table)
- Session (linked to Sessions table)
- ReviewsReceived (linked to Reviews-Table)

I can’t share my actual table because I have lots of confidential stuff in there.

Does that help?

[Next page](https://community.glideapps.com/t/dynamic-filtering-of-multiple-items/72196.md?page=2)
