When you have two cities that have the same name, but they have different counties, then this is important information to have when you want to link a person to the correct city in a relationship.
A dropdown will not suffice (because the city name is the same in both cases), so the relationship overview model should contain the same expression as is already modeled in the advanced workspace for the cities overview:
In the case of the “available items”_OM, this is the exact same expression as used in the overview model:
kontext(City){
case[City]!=“” {
(en: "The city of ", de: "Die Stadt ") [City]
(en: " has the following districts: “, de: " hat die folgenden Bezirke: “)
kontext(Districts){
case[Name]!=”” {
" "
"1. "[Name]
}
}
}
}
However, the generated model for the “selected items”_OM has the document model for “City” wrapped in a “target” context:
Therefore, the expression shown above, in order to work in the “selected items”_OM also needs to be wrapped in that context:
kontext(target){
kontext(City){
case[City]!=“” {
(en: "The city of ", de: "Die Stadt ") [City]
(en: " has the following districts: “, de: " hat die folgenden Bezirke: “)
kontext(Districts){
case[Name]!=”” {
" "
"1. "[Name]
}
}
}
}
}
The end result, when using the table view in the form model and not the dropdown, is shown here:



