Skip to main content
rameshbabub7775
October 18, 2022
Question

expession evalution error while importing excel to interface before submitting

  • October 18, 2022
  • 6 replies
  • 0 views

expression evaluation error at  "readexcelsheet"

readexcelsheet(
excelDocument:ri!Spreadsheet,
sheetNumber: 1,
startRow: 2,

)

ruleinput is document

6 replies

stefanhelzle0001
October 18, 2022

If you expect helpful answers, you should give us some more details.

rameshbabub7775
October 18, 2022

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

October 18, 2022

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 .

stefanhelzle0001
October 18, 2022

A uploaded file does not exist before submit. There is no direkt workaround. Check discussions for some alternative approaches.