Good morning bubblers! I have a question which is perhaps half of bubble nature, and another half of programming. While I know how to approach it in a yes-code environment, my bubble knowledge is too shallow. Hopefully you can help me out.
I am building a tree-like data structure, where each parent element contains information about it’s (direct) children. In bubble I say something like “create Card L4-1 and add it to children field of Card L3-1”. This allows me to display the entire structure using nested repeating groups.
The problem comes when I need to delete records with ALL children (including grand-, grand-grand- and so one). As stated above, each card has a record of its children one level down, so that’s easy to delete them. However, further levels remain in the DB.
Now, Bubble allows addressing children’s children as many levels down as one wants using “:plus item”. However, there is no way to know how many children levels current record has, and it would be stupid to write a “formula” with 20 levels (and what if there are 21).
I was thinking that it should be possible not only to update a parent card’s “children” filed, but also a grandparent. But I didn’t find a way how, and again, how far up should I go?
Eventually, I was wondering if someone know of an elegant way of doing it in Bubble. Perhaps, and advanced feature or a plugin?
P.S. I am also flexible about how to structure my DB, so please be free to suggest another approach.