Multilevel category type

I have a CLASS table. For each, class, I have top level categories such as
Math, Science, Biology etc. Then under each, I have further sub-categories such as for math, Calculus, trig, etc. under Math category.
How do I create this structure, such that when I am creating a class, I use a drop down to assign a sub-category to it.
I also need to provide for a way to search my database by these drop-down subcategories.
Thanks.

1 Like

Hi there, @mntcastleā€¦ are you going for something like thisā€¦

classes1

ā€¦ with the added classes displayed in a repeating group like thisā€¦

classes2

ā€¦ and the ability to filter the repeating group (or as you said, search the db) like thisā€¦

classes3

classes4

If thatā€™s what you are trying to accomplish, I did that with a Classes table that includes category and sub category fields, and the categories and sub categories are powered by an option set.

If you are not familiar with option sets, check out this postā€¦

Anyway, I hope I understood your post correctly and that my response can help you to get down a good pathā€¦ best of luck!

Bestā€¦
Mike

1 Like

Thank you ever so much. Yes, this is what I need. I will check out the option sets.
Charan

1 Like

Are there any videos that explain how to set this up. I could not follow manual description.
First question, Is the Option set the name of the set of categories? And then options are the option in the categories?
How would one setup a sub-category. Would I then need to create a optionset for each the categories in the top level?

1 Like

If the example I showed is exactly what you are looking for, I created it with one option set named Classes, and each class (Trigonometry, Algebra, Calculus, Literature, etc.) is an option in the set. The option set has one attribute called category, and on each option, I modified the attribute to be the name of the high-level category (Mathematics, English, etc). That setup looks like thisā€¦

Options:

Attribute for Calculus:

Do you think that can help you get going?

Bestā€¦
Mike

1 Like

I was able to follow your logic for the creation of the data set, but could not figure out what to put on the page. I added a drop down input, where I want to select the main category(such as Math) and then get the options for that category. Not quite sure how that logic works. - Thanks.

Ah, okayā€¦ here is how I set up the drop downs. Here is the main categoryā€¦

ā€¦ and here are the filtered classesā€¦

Does that help?

Bestā€¦
Mike

3 Likes

Hi Mike,

I literally just started learning Bubble just a few days ago, and one of the issues I had been trying to figure out, is exactly what you described above.
THANK YOU SO MUCH!
Iā€™m trying to create a ā€˜listā€™ of States, and a list of local counties in each state. Iā€™d never have thought to use the States as the ā€˜high-levelā€™ category, and the Counties as the options - my thinking had led me to use the States as the options, and I couldnā€™t figure out how to make the counties a ā€˜sub-categoryā€™ of that. So a big thank you, once again.

I do have two questions though, using your examples aboveā€¦

  1. What if I wanted the user to be able to just select/add Mathematics (and by default, all subjects under that class), without having to add any sub-categories? Sort of an ā€œadd ALL Mathematicsā€ situation?

  2. Could I also have a user run a search for just the Mathematics category? Letā€™s assume each Mathematics class (calculus, trigonometry, etc) was linked to some students signed up to that class, and I wanted to pull up a search of ALL students signed up to ALL Mathematics classes?

Thanks again, Mike. Youā€™ve been a great help already!!

Hi there, @obvolutā€¦ welcome to Bubble! Itā€™s great to hear my responses in this thread have helped you outā€¦ thatā€™s the beauty of the Bubble forum for sure!

With regard to your first question, it should be possible (Iā€™d have to test it out to be certain, and I wonā€™t be able to do that anytime soon) with a backend workflow to create the classes and the Custom Events >> Schedule API Workflow on a list workflow action (youā€™d need to be on a paid plan, though). The List to run on would be something like All Classes:filtered, and the filter would be something like This Classes category is some field on the screen's value.

Your second question would be possible, too, and I would probably do it by saving the category along with however/wherever you are saving the student/class associations.

Hope this info is useful as you keep making progress, and again, welcome to Bubble!

Bestā€¦
Mike

Thanks again Mike. Will tinker around with it, and see what I can make happen.

This topic was automatically closed after 70 days. New replies are no longer allowed.