foundation-forms.mapcsvtoschema
Home > @genesislcap/foundation-forms > mapCsvToSchema
mapCsvToSchema() function
Maps CSV rows to schema fields with case-insensitive matching. When uiSchema is provided, CSV headers can also match UI schema labels. Converts values to appropriate types based on schema definition.
Signature:
export declare function mapCsvToSchema(csvRows: Record<string, string>[], schema: JSONSchema7 | undefined, uiSchema?: UiSchema): CsvMappingResult;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
csvRows |
Record<string, string>[] |
The parsed CSV rows |
|
schema |
JSONSchema7 | undefined |
The JSON schema defining the fields |
|
uiSchema |
(Optional) Optional UI schema to map labels to field names on import |
Returns:
Mapped rows and list of unmapped columns