Excel import - Working with character

3
I'm using the latest version of the excel importer. I created a basic excel sheet with some data. The first column contains a name of an article. The name is in this case also the key, therefor only new rows are saved in Mendix. The problem i'm having is that I've an article with the name PANTY'S ... With this example the excel importer resolves in an error... com.mendix.core.CoreException: com.mendix.core.CoreException: Document contains invalid data ... OQL query cannot be parsed: SELECT id FROM "MDM"."ArtikelSubGroep1" WHERE (Naam='CATEGORY - BROOD' ) OR (Naam='01a CATEGORY - KOFFIE' ) OR (Naam='01a CATEGORY - CACAO' ) OR (Naam='ZOUTJES' ) OR (Naam='PANTY'S, NYLONS' ) Error on line 1 character 179: mismatched input 'S' expecting RPAREN What is the best way to prevent this from happening. And of course i don't want to change anything in my import file.
asked
4 answers
3

(Naam='PANTY'S, NYLONS' )

I guess this is a clear Xpath/OQL/SQL injection issue which needs to be fixed asap by whoever maintains the excel importer.

answered
3

Excel bug ?? Is an injection issue. Should suspect you can solve this by creating a MF to change the apostrophe into a double apostrophe, but that does not work.

You can still create a microflow while you wait for the next version: 1. Create a MF which changes the apostrophe in something you can uniquely distinguish (like "'"). 2. Add the MF to the attribute you import (Parse with in the Template). 3. Add a retrieve action after the import in the Import MF to find all values with unique indicator and make a Onchange loop to change all value back to the apostrophe.

Since you are using the Panty field as key field best is not only to make a change and copy to another attribute (and use that another attribute for displaying values in Mendix)

answered
1

This an excel importer bug, if you have specified a column as object key and it contains a character such as ' " or a line break. The XAS will throw an exception
You can rename your value to panties like Marc suggested ;-)
The other option is to wait for the next release, this might take a week or two before the version is updated. If you have some sort of critical deadline please contact our partner manager (floor, jan-mark, ramses)

answered
0

It's not a modeling answer, but your item is named Panty's? Wouldn't it be Panties?

Also, are you importing it as a string?

answered