When you have a field in Type “X” as a “composite type” - bubble’s way of associating an entry to another entry from a different Type, for example Type “Y” -, and you let the user create a new entry in Type “X”which includes filling this composite field’s value, (and hitting save button with workflow to create a thing in Type “X”) would this create a new entry in Type “Y” as well?
If the answer is yes, then when the user comes back to Edit the value in that composite field - for example correcting a typo - the last relationship will probably be lost and bubble will create a new thing in Type “Y” with the new value.
If im correct then here is the problem, since i have other fields in Type “Y”, i would want this specific entry of Type “X” to be associated to this specific entry of Type “Y” even if the user makes an edit.
Or maybe the way it works is that once you created an association to an entry of another Type, bubble connects it by the ID, regardless of the Composite fields value changes, which is also a problem: what if the user do wants to change the association to a different entry of Type “Y”?
If the Y row already exists, then you can create X with a reference to the existing Y. (so select something on a Dropdown set to Type Y.
If the Y row doesn’t Exist, then you need to Save the Y first, then Save the X with reference to Y. And then if you are being multidirectional with your relationships, update the Y with the X.
The way i understood it is, that once an entry in X has a relation to an entry in Y, the same is true that Y has a relation to Xregardless where the composite field lies, in X or Y.
Or does it make a difference? for example when it comes to build searches and other expressions?
So your’e saying that when i want Y to be related to X and later write some expressions to find related things, i should always create a “Composite field” on both sides, Y and X?
Or what does multi-directional mean, is there a situation where you wouldn’t want it to be on both sides?
How would you do it? is it by having the field in Y (that X is referring to) as a composite field referring back to X as well?
For Example in type X, field “Name X” is referring to “Name Y” from type Y, so to build explicit relationship, should i have “Name Y” refer back to “Name X”?
Or should i get a marriage counselor immediately to talk relationships…
When you’re saving a piece of data that you want to be bidirectional for direct referencing, how do you “remove” the relationship on both sides when one side gets deleted or updated?
in your example:
Say you want to change who the author of blog A is, you would create an action that “changes parent blog” and select the new user (author), now you would “change parent blog’s user” and “add” parent blog to its “blogs”.
But how would you tell bubble to remove parent blog from the previously linked user? how do you point bubble to the old author when its already un-linked from the parent blog ?
(I understand that you could do the “remove” action before the “add” action so you still have a reference to the old author via the blog side, but that would still not work for a many-to-many reationship, so lets say a blog can have multiple authors, and now you change who the authors are from a multidropdown, some old stay, some old is removed, how do you tell bubble which to “remove”?)
Meanwhile i came up with a way to do it without requiring a new table, tell me if im right
Always remove parent thing from currently associated thing/'s, before reseting the new list/thing associated to the parent and adding parent to new assiciated list/thing.
So always:
remove parent thing from currently associated thing/'s.
reset the new list/thing associated to the parent thing.
add parent thing to new assiciated list/thing.
That way u always have the correct list on both sides regardless whether you’re creating, modifying, or deleting, and regardless which side you’re currently editing, the many or the one.
But as soon as you want to have a list in order of, say, authors added date… you can’t, or want add in some information about the relationship between the two tables …