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

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    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

  • 0
    Certified Lead Developer
    in reply to Ramesh Babu

    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 .

Reply
  • 0
    Certified Lead Developer
    in reply to Ramesh Babu

    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 .

Children