Import a CSV file in a screen flow
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.
Your events team comes back from a trade show with a spreadsheet of booth scans and wants them in Salesforce as Leads today. With the CSV Parser on a flow screen, the user drops the file, checks which column goes to which Lead field, and presses Next. One Create Records element saves the rows.

Before you start
Avonni Flow Components is installed in your org, and you can create flows and Leads.
You have a CSV file to test with. Copy the sample below into a text editor and save it as
booth-leads.csv, in UTF-8.Run your first tests in a sandbox, or plan to delete the test Leads afterwards: the last step creates real records.
Steps
Add the CSV Parser to the screen
In the screen's component list, search for
CSV Parserand drag Avonni CSV Parser onto the screen.Give it an API Name you will recognize later, for example
leadCsv. You will pick its output by this name in a later step.
The screen canvas shows "No preview is available for this component." That is expected. Click the component: its main settings load in the panel on the right, which can take several seconds the first time. Everything this tutorial needs is in that panel. The Open Component Builder button at its top opens the full settings, including the Parser and Save As Content Document groups, next to a live preview.
Point the parser at the Lead object
Object Name: select
Lead. The default isAccount.Label: replace the default
Upload Accounts CSVwith something your users understand, such asUpload the booth leads (CSV).
Object Name does two jobs. It sets the fields offered in the mapping, and it makes the Records output a collection of Leads, which is what Create Records expects later.
Decide what the file must contain
Turn on Required. Without a file, Next stops with "Required CSV file missing."
In Required Fields To Map, select
Last NameandCompany. A Lead cannot be saved without them, so the screen checks for them before anything else runs.Turn on Show Row Count. After the upload, the user reads "Found 5 rows." under the drop zone and knows the file was read.
Leave Hide Mapping off. It is off by default, and it keeps the mapping section visible so the user can check and fix each column.

Keep the standard Next button
The flow's own footer moves the user to the next element. You do not need an extra button on the screen. If you want a clearer word than Next, rename it in the screen's footer settings, for example Import leads.
When the user presses Next, the CSV Parser runs its checks: a missing file or an unmapped required field keeps the user on the screen with a message.
Save the rows with Create Records
After the screen, add a Create Records element. Label it
Create Leads.Choose to create multiple records from a collection.
Open the collection picker and type the API name of your parser,
leadCsv. Select it, then select Records. The reference reads{!leadCsv.records}.
Records holds one Lead per row of the file, with each value in the field its column was mapped to. The parser also exposes Records Serialized (the same rows as JSON text) and Content Document Id (used when the file is saved in Salesforce). For this flow you only need Records.
Save and test
Save the flow, then click Debug or Run.
Upload
booth-leads.csv. The mapping section lists the seven headers, each with its first three values under it.Company,EmailandPhoneare already matched, because their headers are spelled exactly like the field API names. The other four show an empty picker.Pick a field for each empty one: First Name, Last Name, Title (for Job title) and Description (for Booth notes).
Check that "Found 5 rows." is shown, then press Next.

Open the Leads tab: the five booth leads are there, with the booth notes in Description. If the same export comes back every month, set those four matches once in the flow so the user never has to pick them: see Pre-map CSV columns for a recurring import.
Troubleshooting
Related tutorials
Pre-map CSV columns for a recurring import: set the column matches once so users only drop the file.
Review rows before saving: show every row in a table on a second screen and fix mistakes, like
Lumen Frieghtin the sample, before they become Leads.Import a file stored in Salesforce: read a CSV already attached to a record instead of asking for an upload.
CSV Parser: every setting of the component, in one place.
Last updated
Was this helpful?
