josh50
6
@twain There’s always more than one way to do things in Bubble. Giving the RE the type “Practice Cell” is definitely a workable solution. If your “Practice Cell” Data Type already includes the Player, Period, and Color as fields, then you don’t need to specify them as properties on the Reusable Element at all.
Creating the Reusable Element:
- Set the Type of content to “Practice Cell”
- Put a text inside that displays “Parent group’s Color”
- Build the “ordinal color iteration when clicked” workflow that we’ve already discussed.
Implementing the Reusable Element:
- Place it in the table (once in each Period column)
- Data source = do a search for PracticeCell, where player = that row’s player, period = that column’s period, etc
That ought to do it. However…
I know we’re focusing on the current functionality issue right now, but if this app is a long-term project for you, I’d actually suggest going back and reconsidering your database structure. The Data types you’ve created to represent “junctions” of two things would be better handled by just creating an additional field on the first thing. For example, why have a “Practice Row” data type that specifies a junction of players with one specific practice, when you could simply create a field on the Practice thing called “Players” that is a list of type Player. When you create a table or RG where you want to show players for that practice, you just give “This Practice’s Players” as the data source, rather than doing an entirely separate database search. Similarly, you could create a field of type “Practice” on the Player thing, to easily recall all the practices in which they’re scheduled to participate.
The only true “junction” data type you need to create is what I would call something like “Practice Assignments” (the role your “Practice Cell” is sort of covering now). That Data type should have fields for the Practice and Player Things, a field for Period (create an Option Set “Period” where the options are integers from 1-12), and a field for your existing Shirt Color option set). Then, your whole interface on the page for a given practice could be a single table or RG that just displays data type “Practice Assignments” where the source is "do a search for Practice Assignments where Practice is the parent group’s practice.
I think this restructuring would set you up for a much easier development process moving forward, though I realize it may involve some short term pains given everything you’ve already built. Just didn’t want to leave that issue unspoken.