Dynamic filtering with choice component

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

Your post is missing the link to the video.

Thank Darren, I have added it

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 text column in your Task table. This column will hold the selected value of the choice component.
  • Next, create a Single Value 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 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.

2 Likes

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

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

Hi, in case it can help

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

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”

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

One more question on the video.

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

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 :wink:

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!

1 Like

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.

3 Likes

Ah ok!! I see.

Nothing to do to improve your idea!!

3 Likes

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