Import CSV with split: Cannot invoke method split() on null object

Hi,

Does anyone has import data using the “split” eval with an empty column ?
I tried to import somes roles with menus and permission but when permissions column is empty I have an error :

2018-06-21 15:56:47.723 ERROR 3138 --- [gine[Catalina]]] com.axelor.data.csv.CSVImporter          : Unable to import record: [role.femtonext.exploit, Exploit Team, , ]
2018-06-21 15:56:47.723 ERROR 3138 --- [gine[Catalina]]] com.axelor.data.csv.CSVImporter          : With following exception:
java.lang.NullPointerException: Cannot invoke method split() on null object
        at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:91)

The CSV content sample:

name;description;permissions;menus
role.femtonext.exploit;Exploit Team;;

Do I need to set an empty value like " " or “” in empty column .?

Thank you for your help

Something like that :

eval="myCol != null ? myCol.split(',') as List : []"

Great, you are fantastic :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.