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
How to create rules, conditions and tables for “filters screen” to work properly?
Is it possible to create an action (with confirm button) on “filters screen” that will affect the result on “all items screen”?
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?
I guess the solution is in infinite and dynamic filtering as described in @Robert_Petittotutorial, but in this case filters are part of the same (all items) screen
I am new with Glide, therefore please be gentle
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.
Thank you for your feedback.
It seems your filtering solution is exactly what I am looking for.
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?
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 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
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?
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.
in my items table I created 7 Single Value columns (Configuration => get: First, From: work table > filter 1)
in my filter screen I apply settings for my choice component(s):
– Sheet: work table
– Values: Filter 1
– Display as: Filter 1
– 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)
I’m not sure how to change that?
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?
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 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.
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
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
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.
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:
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
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.