> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/flow/flow-components/csv-parser.md).

# CSV Parser

<figure><img src="/files/KEh8sXv7T3sWc7XubLdf" alt="" width="375"><figcaption></figcaption></figure>

The Avonni CSV Parser lets users upload a CSV file and map its columns to Salesforce object fields — all inside a Screen Flow. The parsed records are exposed as output variables you can use in downstream flow elements to create or update Salesforce records.

{% hint style="warning" %}
The Avonni CSV parser component is great for importing smaller files into Salesforce (think spreadsheets). If you have a big dataset (over 50,000 rows), you'll want to use the Data Loader tool instead. It's designed for those larger imports and offers more features.
{% endhint %}

***

## Tutorials

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>How to use the CSV Parser</strong></td><td></td><td></td><td><a href="/files/cJfIH97fUgCaDPytbUbk">/files/cJfIH97fUgCaDPytbUbk</a></td><td><a href="/pages/mIJcttpq0HsGlMzOjIb0">/pages/mIJcttpq0HsGlMzOjIb0</a></td></tr></tbody></table>

***

## Overview

The CSV Parser operates on three steps:

### Accessing the CSV File

* **Direct File Upload** — users upload a CSV from their local machine through the component.
* **Using a Stored File** — supply a ContentDocument ID, a Base64 string, or a CSV string via the **File Value** property to bypass the file picker and act as a pure CSV mapper.

<figure><img src="/files/tyGNUqbeMkN3rphMY0bu" alt=""><figcaption></figcaption></figure>

### Targeting the Salesforce Object

Specify which Salesforce object the parsed data maps to. This determines which fields are available in the mapping UI.

<figure><img src="/files/iDefFNf6ORv78NFdVgHR" alt=""><figcaption></figcaption></figure>

### Connecting CSV Data to Salesforce

Map each CSV column header to the corresponding Salesforce field. You can:

* **User Mapping** — let the user perform the mapping themselves at runtime.
* **Default Mappings** — pre-configure column-to-field mappings to save users time, especially for recurring imports.

<figure><img src="/files/OYf5YOxHADKgWUS0fGrY" alt=""><figcaption></figcaption></figure>

### Keep Your CSV Files Organized Inside Salesforce

Enable **Save as Content Document** to store the uploaded CSV inside Salesforce (linked to a specific record if needed). This keeps data secure, shareable, and versioned alongside your Salesforce records.

<figure><img src="/files/DfXkDUs0Sq90ogElJATp" alt=""><figcaption></figcaption></figure>

***

## Configuration

To configure it, click the component on the Flow screen. The **Edit CSV Parser Component** panel opens on the right with three tabs: Properties, Interactions, and Style. The sections below mirror the Properties tab.

### Properties

**Object Name** specifies the Salesforce object whose fields are shown in the column mapping UI.

**File Value** accepts a ContentDocument ID, Base64 string, or CSV string. When provided, the file upload input is hidden and the component acts as a mapper for the supplied data.

**Required Fields To Map** designates specific Salesforce fields that must be mapped before the user can proceed. Use this to ensure critical fields are never skipped.

**Default Mappings** pre-maps CSV column headers to Salesforce fields. Configure these as column header / object field pairs to reduce manual work for recurring import tasks.

**Hide Clear All** removes the button that resets all mappings at once.

**Hide Mapping** hides the mapping section entirely and performs automatic column matching.

**Hide Sample Data** hides the sample row shown below each column header in the mapping UI.

**Show Preview** shows a preview of the parsed data after mapping is complete.

**Show Row Count** displays a text message telling the user how many rows were found in the CSV.

**Label** sets the label for the file upload input.

**Required** makes the file upload mandatory before proceeding.

**Disabled** makes the component visible but non-interactive.

### Parser

Fine-tune how the CSV file is parsed.

**Comments** sets a comment prefix (e.g., `#` or `//`). Lines starting with this string are ignored.

**Delimiter** specifies the field separator character. Leave blank to auto-detect from common delimiters.

**Delimiters To Guess** provides an array of candidate delimiters to try when auto-detecting.

**Encoding** sets the file encoding (default: UTF-8). Supports all encodings accepted by the FileReader API.

**Escape Character** sets the character used to escape quotes within a field (default: `"`).

**Fast Mode** enables faster parsing for large inputs that contain no quoted fields.

**New Line** specifies the newline sequence. Leave blank to auto-detect.

**Quote Character** defines the character used to wrap quoted fields (default: `"`).

### Save As Content Document

**Save As Content Document** stores the uploaded CSV as a Salesforce Content Document (file). When enabled, you can also link the file to a specific Salesforce record and give it a custom title.

***

## Styling

The **Style** tab gives you fine-grained control over the CSV Parser's appearance. Configure it from the **Style** tab of the Edit CSV Parser panel.

{% tabs %}
{% tab title="Margin" %}
Controls outer spacing.

* **Top:** Sets the top margin.
* **Right:** Sets the right margin.
* **Bottom:** Sets the bottom margin.
* **Left:** Sets the left margin.
  {% endtab %}

{% tab title="Padding" %}
Controls inner spacing.

* **Top:** Sets the top padding.
* **Right:** Sets the right padding.
* **Bottom:** Sets the bottom padding.
* **Left:** Sets the left padding.
  {% endtab %}

{% tab title="Size" %}
Controls dimensions.

* **Width:** Sets the width.
* **Height:** Sets the height.
* **Min Width:** Sets the minimum width.
* **Max Width:** Sets the maximum width.
* **Min Height:** Sets the minimum height.
* **Max Height:** Sets the maximum height.
* **Overflow:** Controls content overflow behavior.
  {% endtab %}
  {% endtabs %}

## Output Variables

The CSV Parser exposes these output variables you can reference in your flow after the screen. To use them, select the screen element in Flow Builder, then the CSV Parser component, and pick the output variable you need.

### Parsed Records

Updated each time the user completes the column mapping and the CSV is parsed.

| Output variable        | Type              | What it returns                                                                                                                                                            |
| ---------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Records**            | Record Collection | The parsed rows as a collection of SObject records, each field mapped to the column the user connected it to. Use this to feed a Create Records or Update Records element. |
| **Records Serialized** | Text (String)     | The same record collection serialized as a JSON string. Use this when you need to pass the data to an Apex action or a downstream flow that expects a string payload.      |

> **Example:** After the user maps their CSV columns to Contact fields, store **Records** in a flow variable and pass it to a Create Records element to bulk-create new Contacts in Salesforce.

### Others

| Output variable         | Type          | What it returns                                                                                                                                                                                |
| ----------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Content Document Id** | Text (String) | The Salesforce ID of the Content Document created when **Save As Content Document** is enabled. Use this to link the stored file to another record or to reference it in a downstream element. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.avonnicomponents.com/flow/flow-components/csv-parser.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
