Alphabetical sorting in Binding Dropdown - using an expression as column type in available items

Hi, I am trying to show the available items in a Dropdown Binding in alphabetical order, using an expression as column types in the available/selected items overviews.

Business Background: I have an overview showing a list of created “Loss Adjusters”. These Loss Adjusters need to be available in a Dropdown of a Certificate (different FM).

The relationship Certificate-LossAdjuster exists and is included as a Binding in the Certificate form.

I have added a default sorting in the Loss Adjusters Overview Model (which shows the available/selected items) and thought that this should already lead to the desired behavior:

However, in the Certificate Form, the Dropdown does not show the items in alphabetical order, even though the Loss Adjuster Overview is sorted by default as set above.

Certificate form dropdown:

The expression used just combines country and city, both are columns shown in the Loss Adjuster Overview.

kontext(LossAdjuster){
[Country] " - " [RegionCity]
}

What am I missing?

Thanks :),
Natalie

The expression doesn’t know about what you defined in a different overview. Unfortunately, expressions aren’t sortable. In your situation, I would model a helper field that’s a string where you concatenate the country and city into one long string via a computation (similar to what you do in the expression) and use that instead of your expression.

Thanks :). Trying to wrap my head around all the helper fields I see in existing models since I am rather new to modelling… where should I model this helper field, in which DM?? I was thinking about the OM of the Loss Adjuster but I do not want to show an additional column. And within the LossAdjuster_DM doesn’t show the list of all LossAdjusters…

I would model it in the LossAdjuster_DM. Each loss adjuster document will then have your helper field, where the concatenated string of country and city is stored. You won’t use it in any form or (regular) overview models because the user should never see it. You would only reference it in the binding overview models (available items overview and selected items overview).

umm… hoping this is still food for discourse… couldn’t find an answer by using the search. HOW do I concatenate the fields in a computation if one of them is an enumeration :sweat_smile:?
FieldValueAsString only works for numbers and amounts.

image

Hi @natalie-wide-ledge

In addition to @lea-clear-clover’s suggestion to use a computed field, there is another option.

Solution: Using a Computed Field
This will work but please be aware that data cannot be localized. This is the source of your problem.

You cannot concatenate enumerations which have localized labels. See here.

Solution: Add more columns
Although the dropdown binding will only render the data from the first column in the overview, it is technically possible to add more columns.
expressionwithcolumns_model

You can make these extra columns sortable and then you get something like this in the ecommerce Workspace:
Expressionwithcolumns

Please not, this is a workaround for 2024.06 and the sorting options for bindings become a lot more explicit and easier to work with in 2025.06 thanks to the Query API.