I’ve looked at Bubble.is off and on over the past year, and recently decided to give it a more serious try. I’ve been playing around with it for about a week, and am really struggling to understand how to build many-to-one relationships, and where/when things “live”.
First among many questions - is it possible to create a repeatingGroup and populate it with a list before it’s committed to the database? For instance, if I wanted to have tags on a things as it was being created, instead of after it has been saved.
I’m also struggling to understand element “Type of Content” somewhat. Is this a way to bind the currently edited thing from the database, or can it be get/set independant of the database? In other words, can I use something like a local object prior to committing to the DB, or will it always reflect an existing record.
I hope this makes sense - the tool looks really promising, and I’m excited to get these concepts nailed down!
Yes, you can use custom states to create a temporary list. The values in this list are not saved to the database. They’re “saved” to an element on the page and only exist for the current user’s session only. You can use the value of this list as the source of a repeating group. Check out this video on selecting multiple items to see how it works: https://youtu.be/yahP3RyVggY
Type of Content is for defining the data type of the repeating group’s source. So if you want to show a list of Users, then the Type must be set to User. If it’s a list of numbers, then Type must be set to “number.” This is also true for other container elements like Group, Popup, etc. Basically, you just need to make sure that the Type defined matches the source’s type.
I think I’m following your last question about local object… in general, if you’re making a change to a Thing, whether you’re pulling it from a Search or a custom state value, you’re still making a change to that record. The only way to isolate potential changes away from the record is to save them to individual custom states… or other records in your database (though that could get cumbersome). Once you’re ready to commit, you “make a change” to that record, and save the state values to the fields.
As for the many-to-one relationship… a single Thing can have a field that is a list of other Things. This list is not a list of copies. It’s a list of … we’ll call them “links” … to the records. So if I wanted to modify Thing A’s List of Thing B’s first item, I am modifying the actual Thing B record, not some local reference. It’s the same as Searching for a Thing B record, without Thing A involved, and modifying that. This might also be helpful: https://youtu.be/4BB4mZp_C3Q