count the number of excel Sheets

Certified Associate Developer

In the interface user has privilege to upload the excel document, we are using the function readexcelsheetpaging to get the information from the 4th sheet of the uploaded excel. when the user uploads the excel with sheets < 4 expression error is shown. Is there a way to check the number of sheets in the excel uploaded  before passing it to readexcelsheetpaging function?

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    AFAIK, No plugins or built-in functions exist to check sheet count/metadata before reading, making pre-validation impossible.
    Use defensive UI design, Warn users clearly and get confirmation before attempting to read sheet 4. This way, if error occurs, user understands why.

    readexcelsheetpaging() throws a Java exception when accessing non-existent sheets, which cannot be caught in interfaces without try() function.
    However, Appian does not officially support this function as it's hidden. It is recommended to check with your organization or Appian Support before using it in Production.