Skip to main content
Participating Frequently
May 15, 2023
Question

To use index function

  • May 15, 2023
  • 2 replies
  • 0 views

local!excelFormatFromFile: readexcelsheetpaging(
    excelDocument: ri!excelFile,
    sheetNumber: 0,
    paginginfo: a!pagingInfo(1,1),
    numberOfColumns: 11
  ).data.values[1]

Hi,

How can i achieve same result using index function instead of using ".data.values[1]"

    2 replies

    mikes0011
    Brainy
    May 15, 2023

    Use index instead of a square-bracket positional indicator (i.e. "[1]") when you assume the ".values" array may be empty sometimes (but will always at least exist).

    That would look like, roughly,

    index( readexcelsheetpaging(...).data.values, 1, {} )

    Participating Frequently
    May 15, 2023

    Thanks! Its working