> 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

The Avonni CSV Parser simplifies importing data from smaller CSV files into any Salesforce object, with options for handling various formatting.

## Overview

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.

## Tutorials

<table data-view="cards"><thead><tr><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>Import a CSV file in a screen flow</strong></td><td>Build a screen flow that turns a CSV of trade show booth scans into Leads, with the file checked and mapped on screen before one Create Records saves it.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F4aJwqlQ6QRd4HA4qiAVr%2Fcsv-101-tutorial-result.png?alt=media">csv-101-tutorial-result.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/tutorials/components/csv-parser/101-tutorial.md">Import a CSV file in a screen flow</a></td></tr><tr><td><strong>Pre-map CSV columns for a recurring import</strong></td><td>Map the headers of a file that comes back every month once, in the flow, so users drop the export and press Next while required fields stay enforced.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F8HlSKXpeIbkwzg3MruLz%2Fcsv-pre-map-csv-columns-result.png?alt=media">csv-pre-map-csv-columns-result.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/tutorials/components/csv-parser/pre-map-csv-columns.md">Pre-map CSV columns for a recurring import</a></td></tr><tr><td><strong>Review rows before saving</strong></td><td>Show every row of an uploaded CSV in an editable Avonni Data Table, let the user fix typos, then create the records in one step.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FBDW6M3htuWhq3R1mme9F%2Fcsv-review-rows-before-saving-result.png?alt=media">csv-review-rows-before-saving-result.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/tutorials/components/csv-parser/review-rows-before-saving.md">Review rows before saving</a></td></tr><tr><td><strong>Import a file stored in Salesforce</strong></td><td>Import a CSV already attached to a record with File Value, or keep the uploaded file on the record with Save as Content Document.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FXpKxAMAFm2rtrgAW0wXW%2Fcsv-import-a-file-stored-in-salesforce-result.png?alt=media">csv-import-a-file-stored-in-salesforce-result.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/tutorials/components/csv-parser/import-a-file-stored-in-salesforce.md">Import a file stored in Salesforce</a></td></tr><tr><td><strong>Fix encoding and delimiter issues</strong></td><td>Diagnose a CSV file that imports wrong (garbled accents, one giant column, a title row) and fix it with the CSV Parser's Parser settings.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FrO5Sqd8pqGXnuXsmx6XP%2Fcsv-fix-encoding-and-delimiter-issues-result.png?alt=media">csv-fix-encoding-and-delimiter-issues-result.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/tutorials/components/csv-parser/fix-encoding-and-delimiter-issues.md">Fix encoding and delimiter issues</a></td></tr></tbody></table>

***

## Projects

See how CSV Parser fits into a complete Salesforce workflow. This project includes steps to build it with AI or manually.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td><h4><a href="https://docs.avonnicomponents.com/projects/use-cases/inside-a-flow/case-import-wizard">Case Import Wizard</a></h4></td><td>Import Cases from a CSV and match them with Accounts in a screen flow.</td><td data-object-fit="fill"><a href="https://3857391697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdHOej9Pd5IxJNGEJMZKW%2Fuploads%2FzEK3z77Wp3ZqZtwa22I3%2Fcase-import-wizard-cover.png?alt=media">https://3857391697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdHOej9Pd5IxJNGEJMZKW%2Fuploads%2FzEK3z77Wp3ZqZtwa22I3%2Fcase-import-wizard-cover.png?alt=media</a></td></tr></tbody></table>

## How it works

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F4aJwqlQ6QRd4HA4qiAVr%2Fcsv-101-tutorial-result.png?alt=media" alt="A flow screen after a CSV upload: the upload control, the text Found 5 rows, a Mapping section where seven CSV headers with sample values point to First Name, Last Name, Company, Title, Email, Phone and Description, and an Import leads button."><figcaption><p>Columns of an uploaded CSV, each matched to a Lead field.</p></figcaption></figure>

{% hint style="warning" %}
The Avonni CSV parser component is great for importing smaller files into Salesforce (think spreadsheets). The component processes at most 10,000 rows per file: beyond that it keeps the first 10,000 and shows a warning. If you have a bigger dataset, you'll want to use the Data Loader tool instead. It's designed for those larger imports and offers more features.
{% endhint %}

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.

Step by step: [Import a file stored in Salesforce](https://docs.avonnicomponents.com/flow/tutorials/components/csv-parser/import-a-file-stored-in-salesforce.md).

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FCoEO8pecmNubxRybm5JZ%2Fcsv-import-a-file-stored-in-salesforce-file-value.png?alt=media" alt="The CSV Parser settings panel in Flow Builder with Object Name set to Lead and File Value set to the Content Document ID of the Get Records result." width="320"><figcaption><p>File Value set to a flow resource: the component reads a stored file instead of asking for an upload.</p></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="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F72K4yPLaQUerZJODy0Lk%2Fcsv-101-tutorial-panel.png?alt=media" alt="The CSV Parser settings in the Flow Builder screen editor: Open Component Builder button, Label, Object Name set to Lead, Required on, Required Fields To Map with Last Name and Company, Show Row Count on." width="320"><figcaption><p>Object Name decides which fields the user can pick in the mapping.</p></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.

Step by step: [Pre-map CSV columns for a recurring import](https://docs.avonnicomponents.com/flow/tutorials/components/csv-parser/pre-map-csv-columns.md).

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FS1hjfOA2hrmp4aP6XU20%2Fcsv-pre-map-csv-columns-panel.png?alt=media" alt="The CSV Parser panel with Required Fields To Map set to Last Name and Company, and four Default Mappings: First Name to FirstName, Last Name to LastName, Job title to Title, Booth notes to Description." width="320"><figcaption><p>Default Mappings pair a column header with a field, so users of a recurring import skip the mapping.</p></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.

Step by step: [Import a file stored in Salesforce](https://docs.avonnicomponents.com/flow/tutorials/components/csv-parser/import-a-file-stored-in-salesforce.md).

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FCUK0oWIt6eGnEk6I8yDC%2Fcsv-import-a-file-stored-in-salesforce-save-as-content-document.png?alt=media" alt="The Save As Content Document group of the CSV Parser Component Builder, with Save as Content Document turned on and Content Document Linked Entity Id set to the recordId variable." width="320"><figcaption><p>Save as Content Document keeps the uploaded file in Salesforce, linked to the record.</p></figcaption></figure>

## Configuration

To configure it, click the component on the Flow screen. The panel on the right shows the main properties and an **Open Component Builder** button. Click it to open the **Edit CSV Parser Component** window, with two tabs: Properties and Style. The **Parser** and **Save As Content Document** groups are only in that window. The sections below mirror its Properties tab.

### Properties

**Label** sets the text label for the file upload input (default: "Upload Accounts CSV").

**Object Name** specifies the Salesforce object whose fields are shown in the column mapping UI (default: Account).

**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** makes the file upload mandatory before proceeding.

**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. Requires **Object Name** to be set.

**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.

**Disabled** disables the input so users cannot interact with it.

**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 data shown below each column header in the mapping UI.

**Show Preview** shows a preview of the mapping and 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.

### Parser

Fine-tune how the CSV file is parsed.

Step by step: [Fix encoding and delimiter issues](https://docs.avonnicomponents.com/flow/tutorials/components/csv-parser/fix-encoding-and-delimiter-issues.md).

**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** lists the candidate delimiters to try when **Delimiter** is blank. Leave both blank and the parser guesses from its own common set.

**Encoding** sets the file encoding (default: UTF-8). Pick it from the list, for example ISO-8859-1 for Western European files. It applies to uploaded files; a file read through **File Value** is always read as UTF-8.

**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. Enter `\r`, `\n` or `\r\n`; any other value is ignored. Leave it blank to let the parser detect the line endings.

**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).

**Content Document Linked Entity Id** sets the record ID the stored Content Document is linked to, associating the file with a specific Salesforce record.

***

## 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 Component** window.

{% 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.

Step by step: [Import a CSV file in a screen flow](https://docs.avonnicomponents.com/flow/tutorials/components/csv-parser/101-tutorial.md), and [Review rows before saving](https://docs.avonnicomponents.com/flow/tutorials/components/csv-parser/review-rows-before-saving.md) to let the user check them in a Data Table first.

### 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 on. 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
