Filters houses by Choice component

Hi everyone, I want to create a filter of houses using chips of choices, I want to click on the electric fence option and some column like query or something else that works on this case, then filter all the houses that have electric fences, so I click to on button that adds fire alarm, and then Glide filter to me houses they have only electric fences, houses that have only fire alarm and houses that have electric fences and fire alarm, and this is continuing with this logic, i use this solution on other specific filters. I try to use the query column to filter all houses on a sheet that houses that have security items mentioned in text column that is edited based on choices of Choice component

So when you choose both “electric fences” and “fire alarm”, you expect every house that has either of those to show up?

Can a house have multiple attributes? I think what you need here is a Split Text column to convert your filter to an array, another Split Text column on the Houses table to convert the attributes to an array, and then use a relation between them to display in a collection.

2 Likes

Hi and thanks for your answer. Think like this:

house one has an electric fence
house two has an electric gate
house three has an electric fence and an electric gate
house four has security cameras and an electric fence

so I clicked on the button option “electric fence” and the option “electric gate” All four houses have electric fence or electric gate, so I wanted the Glide to show me the four houses on the example

About the Split column to make an array and make some association, I tried to follow this way, but the best I did, was do the filter showed me the all houses that have the options I clicked, but the filter can’t show me the houses that the options was clicked is one of the all attributes that the houses have

I think that I understand your solution, I created a column to add options that I want filtering in houses, and I made a Split text from this column, in the column that has security attributes of the houses, I made another Split text column from this Column, and I has made a Relation column from this two Split column, and I guess that this work! Amazing! Thanks a lot for this help

1 Like

Glad to hear it worked!

1 Like

The terms to filter have changed, I tried to apply your solution to newer filter requirements requested to me, and now I need a filter for country, neighborhood, type of house(house, apartment, terrain), and price, but this last I left for another moment. While I want a filter like that:

type of house in a neighborhood in the city, to make a specific filter, when I choose some city, the relation ignores the neighborhood column and gets all houses in the specified city.

I made one column for each filter type, and after I made a joined list with these columns, a split text column for this joined list, to use on relation. I made to template to make the same result of the joined list column, so they looked for the columns that I wanted to use to filter, like that city, neighborhood, and type for example and I made the split text for this column to use on relation, but not work as I expected.

Try not to use relation… maybe IF includes will work better and simpler.

Thanks for your answer, can you share an example with me for better comprehension?

relations are good but confusing… especially for someone not used to it…

You can use the IF ELSE column to check if the category is included in the choice component column

I guess has try that, but anything logic I try doesn’t work, but I go try more times and different combinations

2 Likes

In a nutshell, this is how I would do it: 1 table for the list of items, 1 helper table for the query column, choice components to write to the helper table, a few user-specific columns associated to these choice components to filter the query column.

In detail:

In the Data Editor

  • A table with a list of all of the houses which you can call Houses
  • A 1-line helper table which you can Filter
  • In the Filter table, a query column pointing to the Houses table
  • In the Filter, one column per filter you will use in the layout editor (one column per choice component, per date picker, etc.). Make sure these columns are user specific. Preferably, use text columns rather than number columns especially if you will be allowing multiple-select on choice component.
  • Now adjust the query column with filtering.

In the Layout Editor

  • Display filter components
  • Display a collection pointing to the query column
3 Likes

Thanks for all, I tried all the solutions that yours was shared with me, I have tried to apply those solutions in the show form screen component and nothing was works well, now I have made a functional filter using a container, and put it in the switch component to control visibility of container that contains the filter options based on desired columns, and I think that works well now, but the CEO insist asking for the show form for better intuitive using feel, case someone has a solution for this case, I need something simple, because these filter options exists on different spreadsheets and the complexity is a snowball for me.

A form screen doesn’t write anything to the table until the form is submitted. If you still want a separate screen for your filters, then I suggest using ‘Show New Screen’ → ‘This Item’ instead.

3 Likes

As Jeff said, the show form screen is about adding data. Yet your initial post was about filtering a collection. So the information you have been gathering was to filter data that is being read, not to add data.

You said it yourself, “I need something simple, because these filter options exist on different spreadsheets and the complexity is a snowball for me.”

If I were you I would try to keep things as simple as possible. A simple database structure, simple columns in your tables, simple user experience in the layout.

I’m writing this here publicly but really I am saying it to myself: keep things simple. I struggle with this all the time. Unless you become a Glide power user or really know what you are doing, complexity will discourage you, things will break and eventually your application could flop.

4 Likes

Thanks for your answer. I will explain better what I need.

I have the spreadsheets: houses, cities, neighborhood

I need to filter houses by city, neighborhood, bedroom, and value, but in the filter of value, I think that implementation is hardest, so I think is better to focus on the other three mentioned.

In a better case, add one button “Advanced Search” for example, and on the modal form that appears, the user filters by their interest, when they submit, redirect to one page that shows the houses filtered by choices of the user.

I guess need to make another spreadsheet, to receive the filter options of user interest and use this spreadsheet, but I traditional software engineer, and in Glide I have difficulty understanding the logic and other things related to a spreadsheet and how Glide uses this to cross data, means a joke but this frustrated me some.

1 Like