csv-column-validator
Service icon

CSV Column Validator

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 29 Sep (11 hours ago)
 by 
0.0
 (0 ratings)
csv-column-validator

CSV Column Validator

Details
CSV Column Validator is a reusable OutSystems component for validating CSV file column headers against a predefined list of required columns. It helps applications quickly identify missing, found, and unexpected columns before further processing or business validation.
Read more

CSV Column Validator is an OutSystems component that validates the column structure of a CSV file before it is processed or imported by an application.

The component reads the first row of the CSV as the header row and compares the detected column names against a user-defined list of required columns. It returns the columns found in the file, identifies missing required columns, reports unexpected columns, and provides a validation result and error information.

Features

  • Validate CSV header columns against a required column list.
  • Support configurable CSV delimiters such as comma (,), semicolon (;), or other single-character delimiters.
  • Support case-sensitive and case-insensitive column comparison.
  • Optionally trim leading and trailing spaces from column names.
  • Detect empty column names.
  • Detect duplicate column names in the CSV header.
  • Detect duplicate column names in the required-column definition.
  • Identify missing required columns.
  • Identify unexpected columns that are present in the CSV but not included in the required-column list.
  • Handle UTF-8 CSV content and remove a UTF-8 BOM when present.
  • Support quoted CSV header values and delimiters contained inside quoted values.
  • Handle escaped double quotes within quoted column names.
  • Return detailed error information when the CSV cannot be validated.

Available Action

ValidateCSVColumns

Validates the column structure of the supplied CSV file.

Inputs

  • CSVContent — Binary Data containing the CSV file content.
  • RequiredColumns — Comma-separated list of column names that must be present in the CSV header.
  • Delimiter — Single-character CSV delimiter. If not provided, comma (,) is used.
  • CaseSensitive — Determines whether column-name comparison is case-sensitive.
  • TrimColumnNames — Determines whether leading and trailing spaces are removed from CSV and required column names before comparison.

Outputs

  • IsValid — Indicates whether all required columns are present in the CSV.
  • FoundColumns — Comma-separated list of column names detected in the CSV header.
  • MissingColumns — Comma-separated list of required columns that are not present in the CSV.
  • UnexpectedColumns — Comma-separated list of columns found in the CSV that are not included in the required-column list.
  • ErrorMessage — Provides technical or structural error information when validation cannot be completed.

Validation Behavior

IsValid is set to True when all required columns are present in the CSV header.

Unexpected columns are reported separately through UnexpectedColumns and do not, by themselves, make the validation invalid. This allows applications to accept CSV files that contain additional columns while still enforcing the presence of required columns.

Structural problems such as empty column names, duplicate CSV columns, duplicate required columns, invalid delimiters, empty CSV content, or malformed quoted header values are returned through ErrorMessage.

Example

Given the CSV header:

id,first_name,last_name,email,age,city,salary,joined

and required columns:

salary,city

the component returns:

IsValid = True

FoundColumns = id,first_name,last_name,email,age,city,salary,joined

MissingColumns =

UnexpectedColumns = id,first_name,last_name,email,age,joined

If a required column such as country is not present, the component returns:

IsValid = False

MissingColumns = country

UnexpectedColumns contains the columns present in the CSV that were not required.

Case Sensitivity

When CaseSensitive is enabled, column names are compared using case-sensitive matching.

For example:

Email ? email

When CaseSensitive is disabled, the comparison is case-insensitive:

Email = email

Column Name Trimming

When TrimColumnNames is enabled, spaces around column names are removed before validation.

For example:

salary is treated as:

salary

CSV Header Parsing

The component supports quoted header values and correctly handles delimiters inside quoted values.

For example:

"Customer, Name",Age,City

is interpreted as three columns:

Customer, Name
Age
City

Escaped double quotes inside quoted column names are also supported.

Use Cases

CSV Column Validator can be used before importing or processing CSV files in scenarios such as:

  • Data migration
  • Bulk data uploads
  • File import workflows
  • Scheduled CSV processing
  • External data integration
  • User-uploaded CSV validation
  • ETL and data transformation workflows
  • Ensuring uploaded files follow a predefined column structure

Demo Application

A dedicated demo application is included to demonstrate the component's validation behavior. The demo allows users to provide a CSV file, define the delimiter and required columns, configure case sensitivity and column-name trimming, and view the validation results.

The demo displays:

  • Whether all required columns were found
  • Columns detected in the CSV
  • Missing required columns
  • Unexpected columns
  • Validation errors

The example scenarios demonstrate both successful validation and validation failures when required columns are missing.

Notes

The component validates the first CSV header row and does not validate the data rows themselves. It is intended for validating CSV column structure before subsequent processing.

RequiredColumns is provided as a comma-separated list independently of the CSV Delimiter. For example, a semicolon-delimited CSV can still use Name,Age,Email as the required-column definition.

CSV Column Validator provides a lightweight way to validate CSV structure in OutSystems before allowing the file to proceed to downstream processing.

Release notes (1.0.0)
License (1.0.0)
Reviews (0)
Team
Other assets in this category