Forum Documentation Showcase Pricing Learn more

I'm new to Bubble and new help getting started with database column filtering


#1

Hello,

I have a question regarding the filtering /intersection of columns in two different tables. In the first table I have, for example, a thing called Player which has 3 columns (name, age, sport) and for the second table i have created a thing called Coach which consists of 2 columns (name, age_group). The Coach table lists the coaches name and also the age group for which that coach is responsible. What I would like to do is be able to select a drop-down of Coaches, which would then in turn display the names of all of the Players of the age which that Coach will be responsible. So the drop-down will select a coach and then find all of the players (within the player table) of the age that the coach is responsible. I have found some advice on this forum regarding filtering etc:

SQL Joins Vs Bubble Tips

but I am still not quite there yet.

coach
coach.PNG1102x618 29.3 KB

coach1
coach1.PNG862x533 24 KB

I have tried many different workflows for this task but haven’t quite got there yet. Please see pics above of examples of what I have tried previously. I would appreciate any advice on how I can complete this database task. If I can complete this task, I think it will assist me in completing even more complex tasks in the future.

Kind regards,
Gerry


#2

@germccarthy - welcome to Bubble!

With searches, you cannot intersect two different data types (coaches and players) retrieved from searches. However, the proper way of controlling for this is with constraints as a part of a search itself. (You started doing this in your first screenshot).

I created a quick example app to illustrate the setup process. (Note: there’s a limited amount of sample data, but enough to illustrate the concept).

Editor: https://bubble.is/page?name=index&id=coachme-example&tab=tabs-1
Live: https://coachme-example.bubbleapps.io/version-test?debug_mode=true


Dan (creator of LearnTo - 15+ hours of Bubble tutorials and live coaching)


#3

Thank you Dan for your time explaining whats required here. I now understand table constraints and searching a lot better and have been able to implement it on my app.

Are there any free documents, videos or training materials that explain more of these type of database queries? I have watched some videos online but I dont seem to be able to find much database querying material.

Thanks,
Gerry