Special Characters in Enumeration Values

1
Is it possible to use dash (-) or other symbols in names of enumeration values? For example an enumeration value representing "Milk"  with Caption "Milk-Fresh" but in Name field name  "Milk-Fresh" is invalid while "Milk_Fresh" is valid. It seems to be little unfriendly because when end user import and excel data he mentioned as "Milk-Fresh" which excel importer is missing in import operation. it is just one item for thousand of items it is impossible to go and edit each line value. Is there any way to get rid off underscore symbol? any style change? please guide...
asked
2 answers
2

Hi Muhammad,

It's not possible, see:

https://docs.mendix.com/refguide/enumeration-values#properties

What you could do is create your own microflow to import excel data. In this microflow import the data too a non persistent entity. Then after importing the data you could iterate through it and relate to the correct enum values.

Kind Regards,

answered
0

As addition to Corne's answer

The Caption is displayed to the user, the Name is used as database value and within the modeler to validate, change, select etc. an enum value. Thus when exporting, the Caption is used as value in a column. When importing, you need to compare the Caption with the Name to set the correct value in the object member. 

For example

if 
ExcelImportsValue = Milk-Fresh
then 
ModuleName.EnumListName.Milk_Fresh
else
.......

answered