Linoy Bar-Gal
 · CEO at Sorti

Filtering a List Using Two Dropdowns


Hello FlutterFlow Community,
I'm currently facing a challenge with filtering results from a Firestore collection based on two dropdown menus.

Single Selection Dropdown (areaDropDown):

This dropdown allows only one selection.
It maps to a string field in Firestore, named propertyNeighborhood.
Multi-Selection Dropdown (propDropDown):

Users can select multiple options from this dropdown.
It corresponds to a Firestore field that is a list of strings. Even if one of the selected options from the dropdown is present in this Firestore list, it should be considered a match.
Desired Behavior:

If both dropdowns have selections:
Filter results that match the selected areaDropDown value AND contain at least one value from the selected propDropDown values.

If only one dropdown has a selection:
Filter results based on the selection of that particular dropdown only.

If no dropdowns are selected:
Display all results without any filtering.
On page load, I'd like to display the full list of results without any filters applied.

Can anyone guide me on how to achieve this filtering mechanism efficiently, considering my Firestore structure?

Thank you in advance!
Linoy Bar-Gal



5 replies