I need help with an expression due to my rather complex data structure.
The App has a table for buildings (Gebaeude).
Each building can have multiple cases (table Case) and rooms (table Raum).
Each of these rooms has several elements.
As one element can have several cases and vice versa, this gets combined in the in-between table CaseElement.
In the App I navigate through the Building_detail view to its Room_Detail view to its Element_Detail view where the user can add a Case to the Element by adding the CaseElement.
Now, if I want to add a CaseElement to my Element, I want the latest added Case for the same building as the element is in to show up as my initial value.
How do I do it if my Element table doesn’t have the immediate ref to the building table but I have to go through the room table first?