Hi Sophia,
There is no built-in switch case statement like in some other programming languages. However, you can achieve similar functionality using other approaches. One common way to implement a switch case-like behavior in Mendix is by using an enumeration or a series of nested if-else statements.
Hi there,
You can use the decision activity that you would use for regular decisions:
In the case of an enumeration, you would put the enumeration attribute of the object as the expression:
In your case, I’d recommend using an enumeration, as Mendix only allows the condition of the decision to be a boolean or enumeration:
You can use a switch case when creating a variable and that variable could be used in a decision though:
Hope this helps,
Liam