Reading Column Header values from Excel

Certified Senior Developer

Hi Team

How can we read the Column Header values from Excel sheet?

I have a requirement to read the employeeid, firstname, lastname from excel  and store in CDT.

Thanks in Advance

Divya

  Discussion posts and replies are publicly visible

Parents
  • You can use readexcelsheet() to get data from excel .

    then by using that data you can construct CDT,.

    load(
    local!data: readexcelsheet(
    excelDocument: todocument(
    123
    ),
    sheetNumber: 0,
    startRow: 2
    ),
    a!forEach(
    items: local!data.result,
    expression: type!cdt(
    employeeid: index(
    local!data.result[fv!index].values,
    1,
    null
    ),
    firstname: index(
    local!data.result[fv!index].values,
    2,
    null
    ),
    lastname: index(
    local!data.result[fv!index].values,
    3,
    null
    )
    )
    )
    )

Reply
  • You can use readexcelsheet() to get data from excel .

    then by using that data you can construct CDT,.

    load(
    local!data: readexcelsheet(
    excelDocument: todocument(
    123
    ),
    sheetNumber: 0,
    startRow: 2
    ),
    a!forEach(
    items: local!data.result,
    expression: type!cdt(
    employeeid: index(
    local!data.result[fv!index].values,
    1,
    null
    ),
    firstname: index(
    local!data.result[fv!index].values,
    2,
    null
    ),
    lastname: index(
    local!data.result[fv!index].values,
    3,
    null
    )
    )
    )
    )

Children