I’m trying to create a custom state in Bubble.io that stores only the first subcategory from each main category in a store. This state will control the visibility and styling of buttons.
Database Structure:
Store (e.g., Supermarket)
* Main Categories (list)
* Subcategories (list)
Hey, thanks for replying. It helped a little, this info is exactly what I want, but I couldn’t apply the same logic to get that on a Custom State. Not sure if there is a way to do that or I’m missing something in the way.
Have you faced anything similar?
( To be clearer, I’d like to have a list of all first subcategories of all categories. They will be visible as soon as the page is loaded. The information given in the repeating group is exactly what I want, but I couldn’t put it in a custom state )
For Subcategory only and then Map it with Category while adding subcategories.
This way you’ll have more control towards custom states and have robust filter abilities. While creating a custom state make sure you map it with subcategory with datatype subcategory, and it should not be a list. Everytime you fetch subcategory from the RG, it will only fetch data for :firstitem
Let’s say you have Categories A, B, C and each has 2 subcategories 1,2,3,4,5,6 respectively. When you search for categories each items subcategories first item, you expect the list you want in this case [1,3,5], however, what is happening is is that all subcategories will be appended first resulting in [1,2,3,4,5,6] and then the first item will be returned, resulting in [1].
No problem, thanks for reaching out. Can you give access as a collaborator where I can do changes and fixed the issue for you? This would be paid, and I charge $30 hourly. I would charge for 2-3 hours max.