Expression for checking if an enumerate attribute is equal to an enumeration value.

Hi community! What is the correct way of writing an expression for an exclusive split for an enumeration attribute, where I want to check if the value is equal to one of the possible outcomes? Many thanks Austin
2 answers

You have to enter the full enum name, e.g.:

$Object/Status = MyModule.Status.Active

Or you can simply split on


btw. searching the documentation by 'enumeration' and/or 'split' would likely lead you to the right answer much faster.


Hi Austin,

In addition to Fabian's answer, you can always use the getKey() function to get it's Key value if you ever want to match the Enum value to a string, i.e. if you want to check whether a String value from a webservice field matches an Enumeration value A:

String inputString
Enum EnumToCheck (ValueA, ValueB, ValueC)

Expression for your Exclusive Split:

trim(inputString) = getKey(EnumToCheck.ValueA)


You can also use getCaption() to get its caption (presentational value).
Also see Mendix docs: