I am trying to make a search form that will show the results of an input that searches a list within each record.
I have a Data Type that contains a list of grain.
The edit form I have a field that stores a list (as was shown in the shopping cart tutorial), except I use a dropdown that is populated from the first table to select the items for the list.
The lists are showing correctly when I look a the main results on a detail page and in a repeating group.
What I can’t figure out is how to perform a search based on a specific grain. I see that the record stores a unique ID for each instance of each item in the list, so I’m at a loss.
As long as the field on your recipe thing is a list of grains and the dropdown’s type is also grains (rather than text) then you should see an option in the constraint that says…
“contains”
So you would do a “listofgrains contains dropdown’s value” or something similar
As long as you work in things, Bubble handles all the hard stuff about Ids for you. Your dropdown might look like a list of texts (which you have set in Option Caption" but it is really a bunch of things listed out. So you can say “Find me all the recipes that have THIS thing in THAT list”.
I just looked at the editor, and I think your dropdown’s data source should be ‘grains’ instead of ‘grains list’ and then your beer repeating group constraint would be “grain-LOG contains 'Dropdown Grain’s Value”. That would make it so the repeating group would filter based upon the grains within the beer’s grain-LOG list. Since each Beer has a grain-LOG field (type: grains, list: yes), setting up the dropdown to search for grains instead of a grain-list should do it