So I have three entities: Cities, Countries and Continents. All of them have two extra fields: Name, and then also a relation to a “parent” entity.
A City is related to a Country. A Country is related to a Continent.
I want a Custom List with three labels in each item in the template: One for City.Name, one for Country.Name, and one for Continent.Name
I use the Cities entity as my data datasource and then bind the three labels like this:
Label 1: ThisRow.Name (works!)
Label 2: ThisRow.Country.Name (works!)
Label 3: ThisRow.Coyntry.Continent.Name (does not work - blank!)
This is a limitation of the Apps and Data Service. complex relationships aren’t supported. You can only establish relationships one level deep, meaning you can’t create parent-to-parent relationships.
To work around this, you should create a text field for the continent within the Country entity. This way, you can achieve the desired structure.
I’ve reported this issue to the product team, and they are aware of this limitation.
Hmmm… that would be a mess, data-wise and from a maintenance perspective.
It just seems insane to me that there is not a way to traverse data through more than one level?!
Otherwise I might have to do a merge in a server-side process, but from my experience, latency is just crazy so I want to avoid server-side processing at almost all costs. Agree?
You could put an additional relationship to continent into city. It’s a hassle if you have to update the middle level because it also requires updating the lowest level, but in your case your hierarchy should be pretty stable.
Maybe you can jury-rig something with custom fetches and list sources if you really want to, idk Apps - Custom HTML
@Arvind_Kumar1@Stefan_Reutter
My real hierarchy is not City->Country->Continent, it is much more dynamic unfortunately, so a flatter structure would bite me in the as* very quickly. So I think I might just go with a server-side function that can fetch and model a datatable to my liking. Not what I want to do, but that’s life.
If matching keys are present in related entities, then assign the selected city to a variable and use the Query Builder to get the related entity name. A rough example: