Skip to main content
rameshbabub7775
Known Participant
Oct 18, 2022 6:38 AM UTC
Question

expession evalution error while importing excel to interface before submitting

expression evaluation error at  "readexcelsheet"

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

)

ruleinput is document

6 replies

stefanhelzle0001
Brainy
Oct 18, 2022 6:50 AM UTC

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

rameshbabub7775
Known Participant
Oct 18, 2022 7:03 AM UTC

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

Participating Frequently
Oct 18, 2022 7:12 AM UTC

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
Brainy
Oct 18, 2022 7:35 AM UTC

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