Filter Tutorials by Category

I want to create a feature on my tutorials tab which allows users to filter the relevant tutorials by the categories.

I have the following components - Question - I am not sure if the “Choice” component is correct. When i tried to select a category on screen, nothing changes (i.e. still showing the full list of tutorials)

Have you tried the In App filter?

You’ll find it in the Options section of your Collection component.

is this right?

wouldnt it be a setting within choice component?

You only need choice components when you want to create custom filters. For a simple use case such as the one you described, the In App filter should be sufficient.

Does it do the job for you?

This is the format i’m trying to re-create, where in the tutorials tab, there will be categories in circle buttons, and when an user select a category, the tutorials associated with the category will be listed below. And when the user did not select any category, all tutorials will be listed

Will In-App filter work?

Btw, how does the In App Filter work?

The in-app filter is a filter that is specifically built I to the collection.

A choice component is separate from a collection, but if you want to use it to filter your collection, then you need to hook a few things together. The choice needs to write to a column in a table. That column can then be used with the regular collection filter to filter the data. You could also use it to create a relation or query that you could then use as the source of your collection.

sorry, im lost :frowning: If i want to re-create the below , what do i need to do?

I would use a button block or choice component depending on the look you want. Choice will be a lot easier since you can easily do multi-select without some complicated back end logic. That will write a value to a table. From there you need to determine if you will use that written value for a relation/query to use as the source of your collection…or use the value for the collection filter.

Basically you will not be using the ‘in-app’ filter if you have that particular look on mind. You will have to build your own filter logic.

1 Like

can you help me troubleshoot please? Im still struggling with this
is this right?

“Includes” is a dangerous way of doing it unless you are sure a “false positive” can never happen (i.e: a category named “Blue” is returned whilst your selected category contains another category like “Bluespace”).

You can just have two lists showing, one showing when “Selected Category” is empty and you show everything there. In the other, split the selected category into an array using split text, then create a multiple relation using that array, use that for your list.

2 Likes

I can see two issues with your screen shots.

  • Selected Categories is only applied to the first row in the table, so using that column in a filter will only impact that row. You need to apply that to all rows using a Single Value column.
  • Your filter is back to front. It should be either “Selected Category includes Category” or “Category is included in Selected Category”

That said, I agree with @ThinhDinh - this is a fragile approach to filtering. Use either arrays with contains/does not contain, or relations/queries.

2 Likes

I still don’t quite how to resolve this - Is there a tutorial on this?

Can you elaborate in more details on how to solve this ? " * Selected Categories is only applied to the first row in the table, so using that column in a filter will only impact that row. You need to apply that to all rows using a Single Value column."

Add a Single Value column to your Tutorials table, and select First->Selected Category from the same table. You should then see the values from that column in every row. Then refer to that Single Value column in your Collection filter.

2 Likes