Advice with a not-so-simplistic data model

Hoping to get some thoughts on how best to set up this data model.

Context - I am building a fantasy sports app and I have 3 data types:

  1. KEEPER
    -Player name
    -Position
    -Cost (numerical)

  2. KEEPER SET (users can group KEEPERs together to create one KEEPER SET)
    -KEEPER
    -TITLE
    -DESCRIPTION

  3. DRAFT (each draft will include a KEEPER SET)
    -KEEPER SET
    -DATE
    -etc…

Where I’m struggling is how to a) best set this data model up and b) how to interact with Bubble. For example, I tried to add a new database entry for KEEPER SET (see screenshot) but am running into this weird search field:

Secondly, what I’m struggling with is how to associate the various KEEPERs to one KEEPER SET. I’ve set up this checkbox UI but am struggling of how to modify the workflow, but I think I need to be confident in the underlying data model first. Any help would be appreciated!


Im not sure what the best way to set it up would be but you should be able to figure that out as you spend more time building.

I don’t see what’s wrong with the search field, its asking you for the players name to add to the set.

keeper set, keeper should be list of keepers that’s why you’re running into issues.

Hey thanks for the quick reply!

Ok I’ve modified the KEEPER SET, KEEPER field to be a list…

What I mean by the weird search field is that I would try to add an entry, but then nothing happens - it blanks out (see below). This happened whether it was a list or not.

Your database structure looks good to me. If you’re having trouble filtering Keepers by Keeper Set, don’t stress - it’s a weird Bubble thing (it is easier if you set the relation on both tables, but it is less practical).

Here’s what I’d recommend using for the RG’s data source:

Do a search for : Keeper Set (List of Keepers contains [Keeper])

I’d recommend using checkboxes only if you add bulk actions above the table (rather than the three dots slotted for each record). For a bulk action, here’s what I’d set up:

  • Workflow(s) for checkbox

    1. Add a custom state called “selectedKeepers” with type Keeper (list)
    2. New workflow (only when: checkbox value is changed (checked) → change selectedKeepers → add Current row's Keeper
    3. New workflow (only when: checkbox value is changed (unchecked)) → change selectedKeepers → remove Current row's Keeper
  • Workflow for bulk removing Keepers once the user has selected one or more Keepers

    1. Make changes to a Keeper Set: Keepers: Remove list: selectedKeepers

For removing a single Keeper from the Keeper Set, I’d recommend a GroupFocus that references the three dots icon. When a user clicks “Remove” (from the GroupFocus menu), it removes Current row's Keeper from the Keeper Set.

1 Like

From the database, you cannot create a new Keeper - this is a relation field, meaning that you can only add a Keeper to the Keeper List that already exists. If Jalen Hurts has already been added to your Keeper table, then you’ll need to make sure the field is mapped to the player’s name (Bubble defaults to unique id) and click “Add”. :slight_smile:

1 Like

Thank you! I hadn’t considered using states. Let me take a read through of this more thoroughly and try out some of the solutions - I might have some follow up q’s but thanks again

This makes sense - how do I make sure the field is mapped to the player’s name like you’re suggesting?

Here is the screenshot of the KEEPER data type for reference:

I even tried to add the KEEPER’s unique ID to the existing database entry’s search field but the same thing happens where nothing occurs after clicking ‘Add’.

ah nevermind - I figured out the search field. disregard!

So on the Table (using table instead of an RG), looks like I was able to figure out how to bring in the KEEPERs using some of your advice + some trial and error:


I had some questions about the custom states…

  1. Where should I add the custom state 'selectedKeepers"? My assumption is that I should I do it on the Group Container containing all the KEEPER elements, but I’m not 100% sure.
  2. on your point #2 - the new workflow should be triggered when? I assume when the button “Add to Keeper set” is pressed?
  3. Same question for the workflow for removing Keepers - I assume there should also be a button that says “Remove from keeper set”?

Sorry I’m on my 4th week or so of Bubble, feels like I am close but can’t quite put it all together, thanks again!

It’s a learning process - thanks for the screenshots and sharing updates as you build!

In terms of where to place your custom state, although you can place it anywhere, I recommend placing it as high up in the hierarchy as possible that will be easy for you to remember. This can be for the entire page or a Group that is intuitive for you (wherever you won’t forget about it).

To clarifiy about the workflows, I didn’t mention how to add Keepers (only how to delete 1 or many at a time in a way I thought intuitive for users). To add a Keeper to a Keeper Set, it would be the exact same process, except you’ll use “add list” instead of “remove list” for bulk actions and “add” for single actions.

Could you explain what the user flow should look like? I’m not 100% sure how Keeper Sets work since there are already Drafts.

For sure - here’s how I am hoping the user flow works:

  1. A user creates a Keeper via this UI below. They can set the cost and add any notes. This should then create a database entry in the KEEPER data type.

  2. They then can select (single or multi) to add them to a specific KEEPER SET:

  3. When they select ‘add to Keeper Set’ - a list of already existing Keeper Sets should appear. A Keeper can belong to multiple Keeper sets. They can also separately create Keeper Sets similar to how they did Keepers in a different step:

A few things I’m struggling with:
-How to set the custom state. Should the custom state be on the KEEPER or KEEPER SET object?
-Is this the simplest way to accomplish what I’m trying to do?

Any insight would be helpful from you @Keymaker or anyone else!