Script error : Unable to load headers from the XLSX data source

Nessrine
Tera Contributor

Hi, 

I need to load an excel file using a business rule, the file is attached to the data source. The headers start in row 3 (the first rows are for title and languages). 'Header row' field in Data source is 3.

When i test manually (Load all Records) it works but when i use the script i get this error : 
Root cause of JavaScriptException: com.glide.db.impex.datasource.DataSourceException
: com.glide.db.impex.datasource.DataSourceException: Unable to load headers from the XLSX data source: com.glide.db.impex.ExcelLoader2.setImportDataSource(ExcelLoader2.java:94)
com.glide.db.impex.datasource.ExcelDataSource.getLoader(ExcelDataSource.java:71)

This is a part of my script :

 var grDataSource = new GlideRecord('sys_data_source');
    if (grDataSource.get(targetSysId)) {
        var loader = new GlideImportSetLoader();
        var importSetRec = loader.getImportSetGr(grDataSource);
        loader.loadImportSetTable(importSetRec, grDataSource);
        importSetRec.state = "loaded";
        importSetRec.update();
}

Does anyone have an idea what the issue here ?
Thank you for your help

1 REPLY 1

Slava Savitsky
Giga Sage

Have you double checked the Sheet Number and Header Row field values in your Data Source record?

 

What is the full text of the error message? Are there any additional errors in the system log during the import?