How to read each row from excel file

Hi,

JFI, I am new to Appian and do not have admin access. 

I have excel file as below. I want to read each row and process on it. Please suggest me stepwise process for the same 

What I have tried so far is,

1. Created process with Excel data provider template, but when executed as it is, I am getting error as below

[ERROR] 2021-08-02 12:30:48 03s (0h) - java.lang.reflect.InvocationTargetException

Caused by: com.novayre.jidoka.client.api.exceptions.JidokaException: Error invoking method 'processItem' ....

Thanks in advance,

Mohini

  Discussion posts and replies are publicly visible

Parents
  • Hi Mohini,

    You can user readExcelSheet() fn. It will give you a result set.

    use forEach to iterate over the resultset and transform it into your own cdt type.

    a!localVariables(
      local!excelFile: if(
        isnull(ri!docs),
        {},
        readexcelsheet(
          excelDocument: ri!docs,
          sheetNumber: ri!sheetNumber,
          startRow: ri!startRow
        ).result
      ),
      local!flatten: a!flatten(local!excelFile),
      local!finaldata: {
        a!forEach(
          items: local!flatten.values,
          expression: 'type!{urn:com:appian:types:ABC}ABC_testCDT'(
            date: fv!item[1],
            productName: fv!item[2],
            manufacture: fv!item[3],
            clerance: fv!item[4],
            package: fv!item[5],
            shipped: fv!item[6]
          )
        )
      },
      local!finaldata,
      
    )

Reply
  • Hi Mohini,

    You can user readExcelSheet() fn. It will give you a result set.

    use forEach to iterate over the resultset and transform it into your own cdt type.

    a!localVariables(
      local!excelFile: if(
        isnull(ri!docs),
        {},
        readexcelsheet(
          excelDocument: ri!docs,
          sheetNumber: ri!sheetNumber,
          startRow: ri!startRow
        ).result
      ),
      local!flatten: a!flatten(local!excelFile),
      local!finaldata: {
        a!forEach(
          items: local!flatten.values,
          expression: 'type!{urn:com:appian:types:ABC}ABC_testCDT'(
            date: fv!item[1],
            productName: fv!item[2],
            manufacture: fv!item[3],
            clerance: fv!item[4],
            package: fv!item[5],
            shipped: fv!item[6]
          )
        )
      },
      local!finaldata,
      
    )

Children