Advice: Auto-populating List

Hey all! I’m looking for advice on how to approach something for a current project.

I am building a directory of small businesses. My home page shows cards for different categories (clothing, food and drink, etc). When a user clicks a category, I want them to see a list of relevant stores.

I am thinking each store will have a row that has its name and a description.

I am thinking I will create a database of Businesses. Each Business entry will have a Name, Category, Description, and a few more items. I would like to use this database to populate the list for each category.

What is the best way to tackle this? Repeating groups? Is there another approach? Any tips would be much appreciated. Thanks in advance!

Hi @matt_a :wave:

Start by creating a Business data type, as you’ve described, with the fields for Name, Description, etc.

If you want to stay in control of the categories (meaning, you don’t want your users to create them), I’d use an option set for that (Data > Option Sets). It’ll be easier to manage that list of categories if they’re part of an option set. Then, under the Business data type, create a Category field whose field type is that Category option set.

If you do want users to create the categories, then it should be a separate data type with a field for the category name.

Yes, repeating groups to display the list of Categories. Clicking one can take the user to another page or show/hide groups to display another repeating group of businesses constrained by the selected category.

If you put the business RG inside a group on the same page, you can pass the selected category from the first RG to that group. That way the data source of the second RG can be something like “Search for Businesses where Category = parent group’s category” That’s just ONE way to do that to get you thinking/started :slight_smile:

Play around from there and watch lessons on how to pass data around in Bubble’s tutorials and below:



Cheers,
Gaby

Coaching No Code Apps
Join our Facebook group for insider access to no-code development
Get professional development services
Enroll in expert-led courses and products

1 Like

Thanks for the detailed response Gabby! That approach makes a lot of sense. Was able to pull together and MVP pretty quickly with something similar.

Best,
Matt