Import a file stored in Salesforce
Import a CSV already attached to a record with File Value, or keep the uploaded file on the record with Save as Content Document.
The events team attaches the booth scanner export to the trade show's Campaign record the evening the show closes. The next morning, a sales coordinator opens the Campaign and imports the leads from that file, without downloading it and uploading it again.
The CSV Parser covers both sides of this. With File Value, it reads a file already stored in Salesforce: the upload input disappears and the component only maps the columns. With Save as Content Document, it keeps a file the user uploads attached to the record, so the source of an import is always one click away.

Before you start
A screen flow that imports rows with the CSV Parser. Import a CSV file in a screen flow builds one.
A Campaign with a CSV file in its Files related list, for part 1. Any object with Files works the same way.
A way to launch the flow from the record, so it receives the record's Id: a screen flow action on the Campaign page layout, or the Flow component on the Campaign's Lightning record page.
Part 1: import a file already attached to the record
Find the file with Get Records
Before the screen, add a Get Records element named Get_Booth_Scan_File:
Object: Content Version.
Conditions: First Publish Location ID equals
{!recordId}, File Extension equalscsv, Is Latest equals{!$GlobalConstant.True}.Sort by Created Date, descending, and keep only the first record.
This returns the most recent CSV uploaded on that Campaign. Its Content Document ID is the value the CSV Parser needs.
Point the CSV Parser at the file
Select the CSV Parser on the screen. In the right-hand panel:
File Value:
{!Get_Booth_Scan_File.ContentDocumentId}. Pick it from the resource list: the panel shows it as a pill labelled Content Document ID.Object Name, Required Fields To Map and Default Mappings: as for an upload. The file is mapped with the same rules.

File Value accepts three kinds of value:
The Id of a file (Content Document or Content Version)
{!Get_Booth_Scan_File.ContentDocumentId}
The CSV content itself, as text
A text variable or text template holding the rows
The CSV content encoded in Base64
The output of an action that returns a file body
Decide how much the user sees
With File Value set, the upload input is hidden and the screen opens on the mapping, with sample data under each header. The user can still change a mapping before going on.
Leave Hide Mapping off when the files vary, so the user can check the columns.
Turn on Hide Mapping when every file has the same headers and your default mappings cover them. The screen then shows only the row count (and the preview, if Show Preview is on). Pre-map CSV columns for a recurring import explains what is still checked with the mapping hidden.
Turn on Show Row Count either way.
Save and test
Add a Create Records on the CSV Parser's Records after the screen, or a review screen first. Activate the flow, add it to the Campaign page, and open a Campaign with a CSV in its Files.
The screen opens without any upload input. The mapping lists the file's headers with three sample values each, and the row count of the file shows when Show Row Count is on.
Part 2: keep the uploaded file on the record
When the user uploads the file in the flow, the file itself is usually gone once the import is done. Save as Content Document stores it in Salesforce and can attach it to the Campaign, so anyone checking the import later finds the exact file it came from.
Turn on Save as Content Document
Select the CSV Parser and click Open Component Builder at the top of the right-hand panel. In the Edit CSV Parser Component window, expand the Save As Content Document group of the Properties tab. This group is not in the right-hand panel.
Save as Content Document: on.
Content Document Linked Entity Id:
{!recordId}(shown as a Record Id pill once picked). The file appears in the Campaign's Files related list. Leave it empty and the file is saved in the uploader's own files, attached to no record.
Click Done to close the window.

Know when the file is saved
The CSV Parser saves the file the moment the user picks it, before the rows are mapped and before Next:
A "Your content document has been created." toast confirms it.
The file stays even if the mapping fails or the user leaves the flow.
Each upload creates a new file. A user who picks the wrong file and then the right one leaves two files on the record.
File Value and Save as Content Document do not combine: only a file the user uploads is saved.
Use the Content Document Id output
Once the file is saved, the CSV Parser's Content Document Id output holds the new file's Id. Use it after the screen, for example to write it to a field on an import log record, or to link the same file to a second record with a Create Records on Content Document Link.
Troubleshooting
Related tutorials
Review rows before saving: show the stored file's rows in an editable table before creating anything.
Pre-map CSV columns for a recurring import: a stored file often comes from the same export every time, which is when default mappings pay off.
Fix encoding and delimiter issues: when a file is read but the columns or characters come out wrong.
CSV Parser: every setting of the component, in one place.
Was this helpful?
