Filtering – seperate screen

INTRO
I have an “all items screen” with a list of all items (120+) where users can browse through and select one of them. The screen also includes a floating button which is a link to a “filters screen”.


WHAT I WANT

  • I want to make possible for a user to filter items
  • as there are many different filters to display and to choose from, I can’t show all of them on “all items screen” (it would be to crowdy), therefore I created a separate “filters screen” => accessible by floating button
  • “filters screen” includes several filters – choice component (segment, dropdown) with multiple choices
  • based on user filter(s) selection and confirming it by selecting the “confirm button”, I would like to show only the filtered items/results

MY PROBLEM

  1. How to create rules, conditions and tables for “filters screen” to work properly?
  2. Is it possible to create an action (with confirm button) on “filters screen” that will affect the result on “all items screen”?
  3. In the image attached there is no “clear all filters” option, but I guess I want to include that too. Is it possible to make this option/button? How?
  4. I guess the solution is in infinite and dynamic filtering as described in @Robert_Petitto tutorial, but in this case filters are part of the same (all items) screen

I am new with Glide, therefore please be gentle :slight_smile:
Thank you in advance.

Again, another great structure of thread for questions.

What I would do, and actually I just did the same thing this week, is to create a “work table” as @Jeff_Hager and @Darren_Murphy usually call them, to house just the choices. When users click your floating button, you show the details screen for a single row on that filter table. You can have this table in Glide Tables, as our choices are housed in user-specific columns.

What you would try to do is:

  • Bring back all the “filters” to the table you want to filter.
  • Create an If Then Else column to check if the values fit the filter
  • Filter the actual inline list to show only rows where the ITE column is true.

The filter button would just be a go back action.

If you follow my first step then this would be a set column to clear all the filter columns in the work table.

3 Likes

Here is a demo of the filter & sort I did this week to give you an idea. This is an app I’m working on for lowcode.agency alongside @eltintero.

6 Likes

Thank you for your feedback.
It seems your filtering solution is exactly what I am looking for. :muscle:
As mentioned I am quite new with Glide and some things are not as logical to me yet, therefore I am kindly asking for further detailed instructions.


  • “work table” is actually just a separate/new table, right?

  • meaning I have to create columns in “work table” for each choice/filter and write their values in rows, right?

working_table_filters


  • can you please show me an example of these 3 bullet points?

  • I will come back to this one when everything else is cleared

  • I see you are showing the number of results in the floating button. How is this made? … Actually, why is this number switching/different when you switch between “horses” and “filter & sort” screen?
  • if it is possible, I would rather display this number on “items/horses screen” in the space between search field and results => “We found # Items/horses that match your criteria.”

I posted a tutorial yesterday that covers all 3 of those points.

3 Likes

Yes that’s true.

This is actually another sheet where you should house your choice values. My work table contains only 1 row.

It is just icing on the cake, in the Filter & Sort screen it’s the number of values that are found after applying the filter, on the main screen it’s the number of filters that are being applied.

I have been working on this for the past few days (also based on your tutorial @Darren_Murphy, thank you) but I can’t manage to make it work properly. Please help.

Here is what I have done:

  • I created a new work table with 7 columns (+1 row ID)
    – each column represents one filter option (1–7)
    – each filter option has between 2 and 30 value options (filter option one ( 2 ), filter option two ( 4 ), filter option three ( 30 ) etc.)
  • in my basic item table I created 7 user-specific columns (one for each filter option from work table)
  • and then in my filter screen I defined for each of my 7 choice component:
    – sheet: working table
    – values: filter option 1-7
    – data column: item table – user specific column 1-7
    – button action: go back

PROBLEM:

  1. I guess I have to create an ITE column in my item table and this column should collect (and combine) values from all 7 user specific-columns, right? How to do that?
  2. When I manage the ITE column to work then I just need to set a filter rule to the inline list of items at the all items screen, correct? What should be the filter rule?

If so far everything I have done is right, then only conditions and rules are missing to make the filter option work properly. If I have missed something or it should be done the other way around, please let me know.

Okay, the problem with this setup is that each choice will only be written to a SINGLE row in your items table. In order to use the choices as filters, you need those applied to ALL rows.

The easiest way to do this is to move the User Specific columns to your working table, then in your Items table create 7 Single Value columns that will take the user specific values from your working table, and apply them to all rows. You can then create the logic in your Items table to apply the filtering. With 7 choices, the logic could get a bit hairy, but it should be possible.

It’s difficult for me to advise you how to set that up, as I don’t know what your filter choices are, or what the source data looks like. However, one bit of advice I will give is that when creating this type of logic the best approach is to work backwards. That is, instead of looking for matching rows, progressively eliminate rows that do not match. So your if-then-else column might end up being a series of “if foo is not bar then empty” conditions, with a final “else true” condition.

But if you get stuck with it, post a few screen shots and I’ll do my best to help.

1 Like

@Darren_Murphy

  • I have moved user-specific columns to work table
  • in my items table I created 7 Single Value columns (Configuration => get: First, From: work table > filter 1)

PROBLEM:

  • in my filter screen I apply settings for my choice component(s):
    SOURCE:
    – Sheet: work table
    – Values: Filter 1
    – Display as: Filter 1
    DATA:
    – Column: _________ => I need to select work table > Filter 1 column, but I can choose columns only from the item table => why?!

  • as I can’t record user selection in work table I can not get this data in item table (Single Values columns) and then start working on the filter logic


I can provide you some screenshots, but I guess you won’t see and understand much, as my app and naming is in Slovene, not in English. Basically this is how my filter choices look like (just there are 7 filters instead of 4 as seen on this example, but I guess at this point it is irrelevant)

working_table_filters

It sounds like your filter screen is sitting on top of your Items table. It should be on top of the work table.

1 Like

@Darren_Murphy

I’m not sure how to change that? :confused:
I tried to have User-specific columns and Single Value columns in the same *item table" and that works, but I guess it will become really messy after adding ITE logic, right?


@ThinhDinh

Might there be a chance you share screenshots of your tables to help me out? From the video it seems you have done just that what I am looking for.

It can work that way, but it can get tricky if you are not careful. The thing to keep in mind is if you are using Single Value → First on your User Specific Columns, then it will take the values from the first row in your table. And if you are not operating on the first row, then your user specific columns will not be written to the first row, and it won’t work.

This is one reason why I like to build the screen on a separate working table with just a single row. Then when I take a single value of my user specific columns, I can be certain that I’m always fetching the correct row - as there is only one row to fetch.

I would rather not tell where the problem was :no_mouth: In the floating filter button action the data source was set to item table instead of work table. Grrrr … small things. Changing this has solved the problem of creating User Specific and Single Value columns in the right table, as you suggested at the beginning and in your tutorial.


Now I am facing the biggest challenge: how to set the filter logic. In your tutorial you are dealing only with one filter choice. I have 8 of them so it gets tricky. I actually have no idea how to collect and combine all 8 selected filters options and then set a rule/filter to the Inline list (on the All items tab) what to display and what not.

For something like that, I would probably create several IF columns for each filter, and structure the IF statements in a way that returns ‘true’ if a particular filter is not selected or if a row item matches the selected filter. Then you should have a final IF column that returns true only if the other IF columns are all true. Then you can filter based on that final IF column.

2 Likes
  1. How to make an option/button to clear all filters?
  2. How to clear all filters when the user launches the app the next time => is that even possible?
  3. How to show number of filtered results?
  4. How to solve the problem with multiple selection option => in this case Single Value column is showing (at least) two values and IFE column is false as it can’t mach with primary column?

@ThinhDinh you kinda answered these (first and third) questions in your previous posts, but can you (or anybody else) please be more exact how this is done?

filter_results

  1. Since it looks like you want the ‘Clear Filters’ on your list screen as opposed to the filter screen, then I would make sure you have a single Relation, or better yet, a Single Value column (inside of the table for your list tab) that refers to the Whole Row of your filter table. Then you can have a set column action on your clear filter button to clear all of the user specific filter values through the relation or single value row

  2. If a user is not signed signed in, then any user specific columns will be cleared the next time they open the app (as long as it’s been completely shut down as opposed to running in the background). If a user does happen to be signed in, then all user specific values are saved for that user. So in that case, automatically clearing the filters when a user signs in isn’t possible unless you have the user perform some sort of action such as pressing a button. Maybe an initial tab with a button to get started that clears the filters and takes them to a new screen with your list

  3. You could add a rollup count of true values for your final filter IF column. That should give you the total count of all filtered items. If you’re asking about something fancy like @ThinhDinh’s number on the floating button, then he’ll have to advise since that would involve some CSS manipulation.

4 Likes
  1. Success! :muscle:
  2. Success! Displaying clear all filters button on “all item screen” and “filter screen” kinda solves (for me) the problem for signed in users
  3. Success! :partying_face: Not as fancy as @ThinhDinh but even fancier :wink:

  1. @Jeff_Hager I think I edited my post and added question #4 right before you posted your answer. Can you help me out with that one too?
1 Like

You could try using the ‘includes’ or ‘is included in’ operators in your IF column.

  1. Works well!

But there is one more thing related to this #4 question => I have two filter option that I would like to join into one => see image below:


  • why? Because my item can have two filter options aka data columns (out of 8) that are actually the same (same value options)
  • for each of the items data is selected/filled first column first, then second column
  • here are all possible combinations:

filter_option2


  • nevertheless I would like to give the user the option to select this A1-A3 option (from two data columns) only with one choice component, allowing multi selection

filter_option3

  • the data is then recorded to one User-specific column, from there to Single Value column and at the end to ITE column to get correct filter results
  • with all the other data and filter options it works (see @Jeff_Hager solution above), but in this case if user selects (in filter screen) under choice component for example two options (Option A1 and Option A2), I do not return him any results (0), nevertheless there are for example two items in my database that meet this criteria (for example item 1 includes Option A1 and Item 2 includes Option A2 in one of two data columns).
  • in case user selects only one option from choice component, I can return him correct result(s)

I hope it is understandable what my (hopefully last filtering) issue is.