I got a Multidropdown where the User can pick different catgories (from an set up option set for categories). Now I have a repeating group which shows pictures which have a categories value that can contain 1 (minimum) to 3 (maximum) categories from the above mentioned option set.
Now I want to update the repeating group, whenever the user adds a category in the multidropdown so that it shows all pictures that have the category the user chose.
Multidropdown is empty —> All pictures are shown
User choses “Summer” and “Winter” value in the Multidropdown —> Only Pictures with either Summer or Winter in the category value are shown
To update the repeating group based on the selected categories in the multidropdown, you can use the “On change” event of the multidropdown to trigger a workflow that filters the repeating group to only show pictures that have the selected categories.
Here is an example of how you can set this up:
First, create a multidropdown field in your data model and set up the options for the categories.
Next, create a repeating group and set the data source to be the collection of pictures that you want to show.
In the repeating group, create a filter that checks if the category field of each picture contains any of the selected categories in the multidropdown.
Finally, create a workflow that is triggered by the “On change” event of the multidropdown and filters the repeating group using the filter you created in step 3.
This way, whenever the user selects a new category in the multidropdown, the repeating group will automatically update to show only the pictures that match the selected categories.
Thanks for your fast reply!
I understand everything you said, but somehow I cant manage to set the filter right for Step number 3.
Could you please show me how a filter would look with “Do a search” that checks if the picture category include one of the multidropdown values?
Shouldnt it look like that: “Pictures Categories contains Multidropdowns Categories value”
But this wont work because i think both of them are lists
Sure, here is an example of how you can create a filter in a repeating group in Bubble to show only pictures that have a category matching any of the selected categories in a multidropdown:
In your data model, create a field to store the selected categories in the multidropdown. This field can be a list of text values or a list of reference values, depending on how you have set up the options for the categories.
In the repeating group, create a filter condition that checks if the category field of the picture contains any of the selected categories. Here is an example of how you can set up the filter condition:
Field: category (the field in the picture data type that stores the categories)
Operator: contains any of
Value: [selected categories field] (the field in your data model that stores the selected categories)
Save the filter and test it by selecting different categories in the multidropdown. The repeating group should show only the pictures that match the selected categories.
I hope this helps! Let me know if you have any questions or need further assistance with creating a filter in a repeating group in Bubble.
If the images had only one category this could just be a single search of images where “category is in mutidropdown value” with “ignore empty contreints” checked. The filtering would happen in the backend and bubble would automatically request new data when the input of the dropdown changes (no workflow needed).
Because the category of an image is a list you need to filter the search client side and use a condition, but still no workflow is needed:
set the data source of the repeating group to a search for all the images. This will be the default data when nothing is selected in the multi-dropdown.
add a condition when the “multidropdown value count > 0” and set the data source to a search of all the images filtered by this advanced filter:
I have this exact same situation as well but I have a search button which triggers the search. So your method works but it fires the search before the search button is clicked. Is there a way to do this in workflows?