Forum Documentation Showcase Pricing Learn more

Dependent Dynamic Dropdowns with a third 'Thing' as a connection

Hello World!

I’m new of this fantastic Bubble planet.

I’m designing a website in which there are 2 main Things (Players, Teams). I created also another Thing which represents the relationship between the two (a player can stay in N teams, a team can have M players) + some specific attributes like the season.

Now, I want to introduce another 2 Things called Drill and Performance. A Drill is an independent thing like Players and Teams, while Performance is the relationship between the tree + some specific attributes as the score of the performance.

At the moment I’m struggling with the page in which it is possible to record a new Performance for an existing drill made by a player for a specific team.

The fields to be filled in this page are:
Drill -> dynamic dropdown that shows every drill created - NO ISSUE
Team -> dynamic dropdown that shows every team created - NO ISSUE
Player -> dynamic dropdown that shows every player of the team selected above - ISSUE
Score -> input field - NO ISSUE
Date -> date field - NO ISSUE

Here you can find the screenshots of the player’s dropdown settings:
1%20player%20drop
where Giocatore = Player and Appartenenza is the relationship between a player and a team
Down here you can also see the “Search for Appartenenza” that I set:
2%20player%20drop
My problematic dropdown shows a player in the case there is only one player in the team, otherwise it doesn’t have any value visible in the dropdown.

I used the debugger and it shows that the “search for giocatore” gets some results after the constraint, but none of them is shown as an option in the dropdown
Annotazione%202019-08-14%20000500

How can I solve the problem?

Thank you in advance for your help!

Simone

This feels more complicated than maybe it needs to be. Why not have a list of players on each team?

because there are specific additional information that are linked to a particular player in a particular team, and they are attributes of that relationship, not of the player or the team

Sorry for the lag in response here. I think there are 2 paths forward:

  • Create a third field on the team for just players
  • Instead of using “Search for Giocatores” you can use a “Search for Appartenenzas:first item’s Giocatores” where you set the constraint of which team to specify.

One more question: why are you using unique ID’s everywhere instead of the team or player object itself?

Thank you Andrew for your reply: I’ll first try with the second approach you proposed and I’ll update you here in the thread.

Concerning your last question, I use IDs just because I thouth they would be more suitable to transfer information via URL parameters. Do you think that was not a good move?

thanks again,
Simone

You can still get to the unique ID for URL parameters if you use the “thing” itself in the database. I think it comes down to this: Is it more painful to be working in the editor one way over the other? And the answer to that is going to be based on how often you’re using URL parameters vs how often you’re using the type of behavior you outline above.

It’s all possible the way you’re doing it, so I wouldn’t worry about things breaking, it just might be a headache is all.