# Dynamic filtering with choice component

**URL:** <https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663>\
**Category:** Ask for Help\
**Created:** [January 4, 2022, 7:26am UTC](https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663 "2022-01-04T07:26:35Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul\_Okoduwa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/paul_okoduwa/32/36349_2.png) [@paul\_Okoduwa](https://community.glideapps.com/u/paul_Okoduwa)\
**Post date:** [January 4, 2022, 7:26am UTC](https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663/1 "2022-01-04T07:26:35Z")

</div>

Hello, I’m building a TODO list application with different categories. I want the list to filter automatically based on the choice selected choice by the user.

I have used visibility and sort but It’s not working.

here’s a video of what I currently have.

[https://www.loom.com/share/da9bc8cf8fd94df080ebb56aa57f49d4](https://www.loom.com/share/da9bc8cf8fd94df080ebb56aa57f49d4)

---

<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:** [January 4, 2022, 7:30am UTC](https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663/2 "2022-01-04T07:30:15Z")

</div>

Your post is missing the link to the video.

---

<div class="post-metadata">

**Author:** ![paul\_Okoduwa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/paul_okoduwa/32/36349_2.png) [@paul\_Okoduwa](https://community.glideapps.com/u/paul_Okoduwa)\
**Post date:** [January 4, 2022, 7:39am UTC](https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663/3 "2022-01-04T07:39:39Z")

</div>

Thank Darren, I have added it

---

<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:** [January 4, 2022, 8:00am UTC](https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663/4 "2022-01-04T08:00:50Z")

</div>

Okay, one thing you didn’t show in your video is how your choice component is configured.

Anyway, that doesn’t matter. You can get what you want with a single inline list. Here is how to do it:

- Firstly create a [User Specific](https://docs.glideapps.com/all/product/data-editor/user-specific-columns) text column in your Task table. This column will hold the selected value of the choice component.
- Next, create a [Single Value](https://docs.glideapps.com/all/topics/computed-columns/primary/single-value-column) column. This will take the value of the user specific column and apply it to all rows in the table.
- Finally, an [if-then-else](https://docs.glideapps.com/all/topics/computed-columns/primary/if-then-else) column. The purpose of this one is to apply the filter logic to each row. It will return `true` for any row that needs to be filtered (excluded) from your list. It should be something like:  
– If single value is empty, then empty (this is when we want all rows)  
– Else if Task category is not single value, then `true` (if it doesn’t match the selected category, then exclude it)
- Now you just need a single inline list component, and set the filter option to “where if-then-else column is not true”

And that should do it.

---

<div class="post-metadata">

**Author:** ![paul\_Okoduwa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/paul_okoduwa/32/36349_2.png) [@paul\_Okoduwa](https://community.glideapps.com/u/paul_Okoduwa)\
**Post date:** [January 4, 2022, 8:21am UTC](https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663/5 "2022-01-04T08:21:19Z")

</div>

Thank Darren. I can’t seem to find a way to update the user specific value on selecting a choice button.

---

<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:** [January 4, 2022, 8:24am UTC](https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663/6 "2022-01-04T08:24:31Z")

</div>

In the Choice component configuration, there is a “Data” option (see below example). This should be targeted at your User Specific Column.

 ![Screen Shot 2022-01-04 at 4.22.52 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/7/37bbf0a147004f6b8461b8c851ab94e723b86c0b.png)

---

<div class="post-metadata">

**Author:** ![AyS\_0908](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ays_0908/32/27349_2.png) [@AyS\_0908](https://community.glideapps.com/u/AyS_0908)\
**Post date:** [January 4, 2022, 8:31am UTC](https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663/7 "2022-01-04T08:31:37Z")

</div>

Hi, in case it can help

> [@"Dynamic group-by" inline list](https://community.glideapps.com/t/dynamic-group-by-inline-list/14855):
>
> Hi, in case this is not a common workaround, happy to share an approach to have an inline list “dynamically grouped by” a choice component. This enables users to choose how to group-by the results of the inline list (+ to reduce the nb of inline list by x if we had 1 by ‘group-by’ criteria) Challenge: I’ve got 1 tab for [Search] and 1 for [Content]; I had to separate them because the [Search] tab displays elements of various tabs. In the [Search] tab, I have a ‘choice component’ for the ‘gr…

---

<div class="post-metadata">

**Author:** ![paul\_Okoduwa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/paul_okoduwa/32/36349_2.png) [@paul\_Okoduwa](https://community.glideapps.com/u/paul_Okoduwa)\
**Post date:** [January 4, 2022, 9:05am UTC](https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663/8 "2022-01-04T09:05:24Z")

</div>

hey Darren, I think am missing the conditional statement. pls help me look at it

 ![glideifthen](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/0/c0fb8cb02fa3af96ed94c8b918e0ee23ae66cfcf.png)

---

<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:** [January 4, 2022, 9:08am UTC](https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663/9 "2022-01-04T09:08:55Z")

</div>

Two problems:

- In the first case, instead of the word “empty”, just leave it empty (no value)
- In the second case, you should be comparing your Category column to the single value column, ie. “if Category is not choice single value, then true”

---

<div class="post-metadata">

**Author:** ![paul\_Okoduwa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/paul_okoduwa/32/36349_2.png) [@paul\_Okoduwa](https://community.glideapps.com/u/paul_Okoduwa)\
**Post date:** [January 4, 2022, 9:31am UTC](https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663/10 "2022-01-04T09:31:48Z")

</div>

Thank Darren. It worked. knowing this will really help me build app with complex filtering.

One more question on the video.

---

<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:** [January 4, 2022, 10:17am UTC](https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663/11 "2022-01-04T10:17:29Z")

</div>

It looks like your choice component is writing the selection to your Category column.  
You need a separate (User Specific) column for that.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [January 4, 2022, 4:08pm UTC](https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663/12 "2022-01-04T16:08:46Z")

</div>

Hola!

I don’t know if I missed something on the way but I had done easier (assuming that Paul will use **an only one Choice** component).

The InLine List supports a multiple relation as a data source so, let’s use it!!

1- Create a USC to hold the category selected by user  
2- Create a multiple relation using the above USC with Categories table’s Category column. Let’s name it “rel\_Cat”  
3- Put your InLine List and set its data source (Sheet Source) to work with “rel\_Cat” relation  
4- Enjoy the solution 😉

But if @paul_Okoduwa is going to use 2+ choices later to get a dynamic filter, the steps showed by Darren or Robert in his video are good choices although we have a plan B as well.

Saludos!

---

<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:** [January 4, 2022, 11:19pm UTC](https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663/13 "2022-01-04T23:19:12Z")

</div>

Yes, there are several different ways to approach filtering. But in this case I don’t think creating a relation is necessarily the best approach. The problem is that it will return no rows when the choice is empty, which is the opposite to what Paul wanted (all rows). So to make it work you’d either need to create additional logic to handle that case, or use a second inline list component.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [January 5, 2022, 3:03am UTC](https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663/14 "2022-01-05T03:03:17Z")

</div>

Ah ok!! I see.

Nothing to do to improve your idea!!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [January 6, 2022, 3:03am UTC](https://community.glideapps.com/t/dynamic-filtering-with-choice-component/36663/15 "2022-01-06T03:03:24Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
