Error handling when importing decimal attributes using ExcelImporter

0
Hi, For my application I need to import Excel files. One of the fields is supposed to be a decimal and is mapped to an attribute of the type Decimal in my import entity. However, when the import field contains a string value this somehow converts to a decimal value in the import process ("n.v.t." = 36,00, "nvt" = 123,00) without any errors / notices. I tried to set the following handler flow in the import template, but this shows the same behavior   Anyone run into similar problems? I would expect an error from the importer to prevent an import of wrong values. 
asked
2 answers
0

Ok, so the fix/workaround is the following, which either returns a properly parsed decimal or an empty value when parsing fails:

 

answered
0

Hi Kelvin,

If the column in the excel you would like to import contains decimals, it is indeed possible to directly convert them to decimals in Mendix. By making sure the excel consists of only decimals in this column this would not give you any problems.

If however you are not sure if there are string values between the decimals you could do a work around like you suggested. Might be smart to put an error handler on the creating variable where you parse the decimal. In the case that this action breaks you have the option to throw an exception.

answered