Hi everyone ,
I have a scenario to use ReadExcelByHeaders.
But it is throwing me an error:Expression evaluation error at function 'readexcelbyheaders' [line 3]: java.lang.NullPointerException: Cannot invoke "java.util.Map.entrySet()" because "expectedHeaders" is null
Discussion posts and replies are publicly visible
If Synonyms is passed, this is working fine.
Hi Anusuya K Mahalingam
Try this logic. It may help you.
a!localVariables( local!synonyms: { "CUST_STYLE_1": { "CUST_STYLE_1" } }, local!matchConfig: { includeUnmatchedColumns: true, fuzzyBoost: true }, local!data: readexcelbyheaders( excelDocument: todocument(5279), expectedHeaders: { a!keys(local!synonyms) }, headerSynonyms: local!synonyms, matchConfig: local!matchConfig ), local!data )
If the name has space, it is nor working. Any idea on this Mekala.
In database structures column names don't support spaces. And the excel columns headers also should not have spaces. This is to ensure proper match in case multiple columns are there with similar names. Thats why in standard practice avoid spaces in column/header names. If you are getting spaces dynamically then use functions like trim() to remove the leading/trailing spaces.