Skip to main content
New Participant
Sep 1, 2025 7:58 AM UTC
Question

How to validate CSV column headers on file upload in Appian?

I have a requirement where users upload a CSV file, and I need to validate whether the column headers match a predefined template before parsing it into a CDT. Is there a way in Appian to check headers during file upload, preferably before running readcsvlogtoCDT()?

    2 replies

    shubhama926776
    Brainy
    Sep 1, 2025 8:53 AM UTC

    Use the previewcsvforimport() function from the Excel Tools plugin with the numberOfRows parameter set to 1, which will read only the first row containing the CSV headers. Extract these headers and compare them against your predefined CDT fields or expected header list or validatedocumentheaders().

    शुभम्
    harshas2775
    Brainy
    Sep 1, 2025 9:02 AM UTC

    You can use the function validatedocumentheaders() from Excel Tools plugin to achieve the expected functionality. 

    Happy to help. Even happier to optimize.