In a form we use an enumeration with pretty long, verbose value labels (in order to explain to the user what the desired input should be).
Now we want to display shorter, more concise value labels in an overview of the same documents.
We’ve researched different options:
A) Computation of a “parallel” enum
We’ve created another enumeration field, with exactly the same values as the enumeration for user input, but with different labels.
EnumUserInput
* value A, label "Option A with extremely long label good for user input, but bad for concise display in an overview"
* value B ...
EnumOverview
* value A, label "Option A"
* value B ...
We’ve created a computation, which tries to compute the value of EnumOverview from EnumUserInput:
FieldFilled(EnumUserInput) : [EnumUserInput]
However, this fails with the following error in SME:
When comparing enumerations, the enumeration values must match (for ‘A’, the values ‘Option A with extremely long label good for user input, but bad for concise display in an overview’ and ‘Option A’ are specified). [MVK_INVALID_COMPARE_ENUM_TO_ENUM]
While I do understand, that enum values should be the same when computing one enum value from another enum, I do not quite understand why this applies to enum value labels as well.
Is it possible to configure this to behave otherwise? Is there a way to work around this?
(in my opinion this used to work in earlier A12 versions, e.g. 2019.02)
B) Expressions in overview model
In form model repeats we could use expressions to conditionally change the label depending on the enum value.
For overview models, no such facility exists (yet).
C) Computation of a string field
We could compute a string field, such that the value of the string field contains the desired label and use the string field in the overview. Roughly like this:
[EnumUserInput] == "A" : "Option A"
[EnumUserInput] == "B" : "Option B"
However, this is hard to maintain and breaks i18n, as we are putting labels into document fields.
I would be happy to learn about alternative options. Thanks!
@oliver.buettner fyi