Convert String to Enumeration

0
Is there any way in mendix to convert a string to a enumeration as i’m trying to that it gives me this error
asked
3 answers
2

Hi Surabhi,

To go from a string to an enumeration, you would have to build a microflow (or nanoflow, depending on your use case) which evaluates the string and return the desired enumeration value based on the given string value

answered
9
  1. Create variable activity (Enumeration)
  2. If $Microphone/Arguments = ‘EnumValue1’ then ModuleName.EnumName.EnumValue1 else if $Microphone/Arguments = ‘EnumValue2’ then ModuleName.EnumName.EnumValue2 else empty
  3. change object, LuggagePlan = $Variable
answered
7

It can be far easier. In the community  commons you have the action EnumerationFromString. Make a copy of the Java action move it to your own module and change the enumeration to the correct one.

Regards,

Ronald

 

answered