expression evaluation error at "readexcelsheet"
readexcelsheet( excelDocument:ri!Spreadsheet, sheetNumber: 1, startRow: 2,
)
ruleinput is document
Discussion posts and replies are publicly visible
If you expect helpful answers, you should give us some more details.
a!localVariables(
local!excel: readexcelsheet( excelDocument:ri!Spreadsheet, sheetNumber: 0, startRow: 2, ), a!forEach( items: local!excel.result, expression: { ProductID: fv!item.values[1], VendorID: fv!item.values[2], ProductCategory: fv!item.values[3], ProductName: fv!item.values[4], CurrentPrice: fv!item.values[5], NewPrice:fv!item.values[6], PriceImplementationDate:fv!item.values[7], ReasonForPriceChange:fv!item.values[8], Comments:fv!item.values[9] }, ) )
getting expression evalution error
Hi we need to index values as well use the below code in items of for loop and in expression directly use the index.
a!localVariables( local!excel: readexcelsheet( excelDocument:ri!Spreadsheet, sheetNumber: 0, startRow: 2, ), a!forEach( items: index(local!excel,"result","values",{}), expression: { ProductID: index(fv!item,1,""), VendorID: index(fv!item,2,""), ProductCategory: index(fv!item,3,""), ProductName: index(fv!item,4,""), CurrentPrice: index(fv!item,5,""), NewPrice:index(fv!item,6,""), PriceImplementationDate:index(fv!item,7,""), ReasonForPriceChange:index(fv!item,8,""), Comments:index(fv!item,9,"") }, ) )
you can use code box .
We have to upload the excel and then only it should display, while using this rule in interface, it is showing same error in interface, so then we couldn't add the file
It is giving the error because readExcelSheet is looking for the file and it is not there. Try to do null check for the file.
A uploaded file does not exist before submit. There is no direkt workaround. Check discussions for some alternative approaches.