Hi All,
Am trying to import the excel file into DB using the Import Excel to Database smart service available in Excel tools. Am getting the following error when i try to run the process
???Unknown column '' in 'field list'???.
My table column names are same as the one in the file header.
Have anyone faced the similar issue , or aware of the constraints for this smart service can suggest on the same please??
Regards,
Thoufiq.
Discussion posts and replies are publicly visible
Hi Thoufiq,
you can use the below readExcelSheet function of Excel Tool plugins like this:
load(local!recordSets: readExcelSheet(excelDocument: ri!document,sheetNumber: 0,startRow: 2,numberOfColumns: 0 /*reading all columns*/).result.values,local!count: count(local!recordSets),a!forEach(items: 1 + enumerate(local!count),expression: load(local!data: split(joinarray(local!recordSets[fv!item],"; "),"; "),'type!{urn:com:appian:types:DTP}DTP_CustomerDetails'(FirstName: local!data[1],LastName: local!data[2],Address: local!data[3],Phone_Number: local!data[4]))))
another way...
load( local!recordSets: readExcelSheet( excelDocument: ri!document, sheetNumber: 0, startRow: 2, numberOfColumns: 0/*reading all columns*/ ).result.values, a!forEach( items: local!recordSets, expression: { 'type!{urn:com:appian:types:DTP}DTP_CustomerDetails'( FirstName: fv!item[1], LastName: fv!item[2], Address: fv!item[3], Phone_Number: fv!item[4] ) } ) )