> 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/tutorials/components/csv-parser/review-rows-before-saving.md).

# Review rows before saving

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.

An events manager comes back from a trade show with the booth scanner export, and one of the leads says "Lumen Frieght". If the file goes straight into Salesforce, that typo becomes a lead someone cleans up six months later.

This tutorial puts a review screen between the file and the database. The [CSV Parser](https://docs.avonnicomponents.com/flow/flow-components/csv-parser.md) turns the file into a Lead collection, an Avonni Data Table shows every row with inline editing, and one standard Create Records inserts what the user approved.

<figure><img src="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" alt="An Avonni Data Table on a flow screen titled Check the leads before they reach Salesforce, listing five leads read from a CSV file with row numbers. Row 3 shows the company Lumen Frieght."><figcaption><p>Every row of the file on a review screen, before any lead exists.</p></figcaption></figure>

## Before you start

* A screen flow with a CSV Parser on its first screen, set to the `Lead` object. If you have never set one up, start with [Import a CSV file in a screen flow](https://docs.avonnicomponents.com/flow/tutorials/components/csv-parser/101-tutorial.md).
* Default mappings for the headers your files use, so the rows reach the review screen with their fields filled in. See [Pre-map CSV columns for a recurring import](https://docs.avonnicomponents.com/flow/tutorials/components/csv-parser/pre-map-csv-columns.md).
* A test file. This one has the typo on row 3:

```csv
First Name,Last Name,Company,Job title,Email,Booth notes
Maya,Okafor,Harbour Point Logistics,Head of Operations,maya.okafor@harbourpoint.example,Wants a demo for the Boston warehouse team
Daniel,Reyes,Kestrel Cold Chain,IT Director,d.reyes@kestrelcold.example,Asked about temperature alerts on shipments
Priya,Natarajan,Lumen Frieght,VP Supply Chain,priya.n@lumenfreight.example,Evaluating carriers for Q1
Tom,Becker,Northgate Distribution,Fleet Manager,tbecker@northgate.example,Runs 40 trucks. Follow up next week
Sofia,Marchetti,Alta Via Imports,Operations Manager,sofia.marchetti@altavia.example,Scanned badge only
```

{% hint style="info" %}
**Why the review screen goes before the writes.** In a screen flow, every screen ends the current transaction and saves everything that ran before it. If Create Records sits before the review screen, the leads already exist while the user is still reading them. Put every write after the last screen.
{% endhint %}

## Steps

{% stepper %}
{% step %}

### Set up the upload screen

On the first screen, select the CSV Parser. Its settings open in the right-hand panel of the screen editor.

* **Object Name**: `Lead`.
* **Required**: on, so the user cannot go on without a file.
* **Required Fields To Map**: `Last Name` and `Company`. A Lead without them will not save, so catch it here instead of at insert time.
* **Show Row Count**: on. "Found 5 rows." under the drop zone tells the user the file was read.

Give the screen's Next button a label that says what comes next, for example `Review the leads`.
{% endstep %}

{% step %}

### Add the Data Table on a second screen

Add a new screen after the upload screen and drop an Avonni Data Table on it.

1. In the right-hand panel, open **Data Source** and choose **Variable**.
2. Pick the CSV Parser's **Records** output from the first screen.
3. Click **Open Component Builder**.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F8p7Wsfod5YHt5EJP6O0H%2Fcsv-review-rows-before-saving-table-source.png?alt=media" alt="The Data Table Component Builder with Data Collection set to Records and an empty preview showing the table header and six column headers."><figcaption><p>The Data Table reads the CSV Parser's Records output.</p></figcaption></figure>

The preview in the Component Builder stays empty and says "Preview does not include data." That is expected: the rows only exist once someone uploads a file.
{% endstep %}

{% step %}

### Choose the columns and make them editable

In the Component Builder:

* Add one column per field the user should check: First Name, Last Name, Company, Title, Email, Description.
* Turn on **Editable** on each column. **All Columns Settings** in the toolbar does it for every column at once.
* In the **Properties** tab, turn on **Hide Checkbox Column** (nobody selects rows here) and **Show Row Number Column**, so the user can say "row 3" when they ask a colleague.
* Under **Header**, write a **Title** and a **Caption** that set expectations, for example `Check the leads before they reach Salesforce` and `Nothing is saved until you press Import`.

More on editable columns: [Making a field editable](https://docs.avonnicomponents.com/flow/tutorials/components/data-table/making-a-field-editable.md).
{% endstep %}

{% step %}

### Turn on Suppress Bottom Bar, and add no save interaction

Still in the **Properties** tab, turn on **Suppress Bottom Bar**. With it on, each correction is applied to the table's rows as soon as the cell closes. Without it, the table shows its own Cancel and Save buttons, and an edit the user does not save with that Save button is dropped when they press Next.

Leave the **Save** interaction empty in the **Interactions** tab. These rows are not records yet:

* **Update Record(s)** fails on rows with no Id and shows "An Error Occurred!".
* **Upsert Record(s)** inserts every row on the spot, and Create Records then inserts them all a second time.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FlgQC52AUEa5XpC4EZREN%2Fcsv-review-rows-before-saving-suppress-bottom-bar.png?alt=media" alt="The Data Table Properties tab with Hide Checkbox Column, Show Row Number Column and Suppress Bottom Bar turned on." width="320"><figcaption><p>Suppress Bottom Bar applies each correction as soon as the cell closes.</p></figcaption></figure>

{% hint style="warning" %}
The Flow Data Table page recommends a save interaction. That advice is for a table that shows existing records from a query. On a review table fed by the CSV Parser, use no save interaction.
{% endhint %}
{% endstep %}

{% step %}

### Create the records from the table's output

After the review screen, add a Create Records element.

1. Choose to create multiple records from a record collection.
2. For the collection, pick the Data Table's **Records SObject Without Key Field** output.

Insert from the Data Table, not from the CSV Parser's **Records**: the table's output is the copy that carries the user's corrections. **Records SObject Without Key Field** also leaves out the temporary key the table gives to rows that have no Id yet.

Label the review screen's Next button `Import the leads`, and end with a short confirmation screen.
{% endstep %}

{% step %}

### Save and test

Save the flow, click Debug or Run, and upload the test file.

* The first screen shows "Found 5 rows." and the mapping under the drop zone.
* Click **Review the leads**. The table lists five rows, row 3 reads `Lumen Frieght`.
* Click the pencil in that cell, type `Lumen Freight`, press Enter. No Save button appears.
* Click **Import the leads**, then open the new lead for Priya Natarajan. **Company** reads `Lumen Freight`.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F28wykajNfms3XG6qkFeI%2Fcsv-review-rows-before-saving-fix-typo.png?alt=media" alt="The review table with the Company cell of row 3 open for editing, showing Lumen Frieght, and no Save or Cancel bar under the table."><figcaption><p>The user fixes the company name before the lead is created.</p></figcaption></figure>
{% endstep %}
{% endstepper %}

## Troubleshooting

<details>

<summary>The lead was created with the original value, not the correction</summary>

The table showed its Cancel and Save buttons and the user pressed Next without pressing that Save. The unsaved edit is dropped and nothing warns the user. Turn on **Suppress Bottom Bar** (step 4). Also check that Create Records reads the Data Table's **Records SObject Without Key Field**, not the CSV Parser's **Records**.

</details>

<details>

<summary>Save shows "An Error Occurred!" on the review screen</summary>

The Data Table has an **Update Record(s)** interaction on **Save**. It needs an Id on every row, and rows from a file have none. Remove the interaction.

</details>

<details>

<summary>Every row was imported twice</summary>

The Data Table has an **Upsert Record(s)** interaction on **Save**. It inserts all rows when the user saves, then Create Records inserts them again. Remove the interaction and delete the duplicates.

</details>

<details>

<summary>The review screen says "Please select minimum 1 row."</summary>

The Data Table is required and its checkbox column is visible, so the user must select a row before Next. Turn on **Hide Checkbox Column**.

</details>

<details>

<summary>The table is empty at runtime</summary>

The Data Table's collection is not the CSV Parser's **Records**, or no file was mapped on the first screen. Check **Data Source** in the right-hand panel and the mapping on the upload screen.

</details>

## Related tutorials

* [Import a CSV file in a screen flow](https://docs.avonnicomponents.com/flow/tutorials/components/csv-parser/101-tutorial.md): build the upload screen this tutorial starts from.
* [Pre-map CSV columns for a recurring import](https://docs.avonnicomponents.com/flow/tutorials/components/csv-parser/pre-map-csv-columns.md): get every column to its field before the review screen.
* [Flow Data Table](https://docs.avonnicomponents.com/flow/flow-components/data-table.md): every setting of the table used on the review screen.
* [CSV Parser](https://docs.avonnicomponents.com/flow/flow-components/csv-parser.md): every setting of the component, in one place.


---

# 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/tutorials/components/csv-parser/review-rows-before-saving.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.
