CSV Parser
Overview
The CSV Parser Flow Screen Component is designed to facilitate importing and handling CSV data within Salesforce. It enables the seamless parsing of CSV files and mapping the parsed data to Salesforce object fields, significantly simplifying data integration processes.
The CSV parser component is not meant to replace tools like Data Loader. It's suitable for importing small to medium-sized data sets, but for larger data sets in Salesforce, it's better to use Data Loader or more robust tools provided by Salesforce.
Support large set of data (max: 50,000 rows)
Utility
The key benefits of using the CSV Parser Flow Screen Component include:
Time-saving: Importing and mapping CSV data to Salesforce objects can be time-consuming, especially with large files. This component automates the process, saving significant time.
Flexibility: The component is not restricted to a particular object or file format, which makes it versatile. It can handle different file values like ContentDocument ID, Base64, or CSV strings and map CSV column headers to any Salesforce object.
Advanced Parsing Options: The component includes sophisticated parsing options like ignoring comments, detecting delimiters, and recognizing escape and quote characters. These advanced features make it a comprehensive tool for all CSV parsing needs.
How to Use the CSV Parser Component
The CSV Parser Component allows you to import and process CSV data efficiently. Follow these steps to integrate it into your screen flow:
Step 1: Create Your Screen Flow
Begin by creating a new screen flow.
Step 2: Add the CSV Parser Component
Drag and drop the Avonni CSV Parser component onto your screen flow canvas.
Step 3: Configure the CSV Parser
Click on "Open Component Builder" to start configuring the CSV Parser.
The most crucial setting to adjust is the 'Object Name
' attribute. This attribute defines the name of the object from which fields are retrieved. It's essential for mapping the CSV column headers to the corresponding fields in your data model. Configure the rest of the settings based on the specific requirements of your data.
The 'file value
', if provided, the component will function as a CSV mapper for that file value. If 'hide mapping' or 'hide sample data' are set, the component will hide the mapping section or the sample data in the mapping section.
In the parser option section, you can configure properties like 'delimiter', 'escape characters', 'quote characters', and more to control how your CSV data should be parsed.
Step 4: Incorporate an Avonni Button for Navigation
Add an Avonni Button Component: This button will enable users to proceed to the next screen after completing data mappings.
Configure the Button: Set a label for the button and choose any branding or additional settings as required.
Define the Interaction: Go to the interaction tab in the Component Builder. Here, set up the button so that when users click it, the flow moves to the next screen. Select 'Flow Navigation Type' and then choose 'Next Screen'.
Step 5: Link a Data Element for Processing
Add a Data Element: Place a data element (like 'Create' or 'Update') below your screen element in the flow.
Connect to CSV Parser: Link this data element to the records collection output of the CSV Parser component. This connection ensures that the new records are created or updated based on the data parsed from your CSV file.
Following these steps, you can effectively use the CSV Parser Component to import and process CSV data within your flow.
Handling Special Characters with the CSV Parser Component
If you encounter issues with parsing special characters such as "á" while using the CSV parser component, it's likely related to the file encoding. Ensure your file is saved in the UTF-8 format to prevent such problems. If the issue persists, double-check the encoding settings and try re-saving the file in the UTF-8 format again. This step should resolve any character parsing issues you might be experiencing.
CSV Parser Properties
Name | Description |
---|---|
Object Name | This defines the name of the object from which fields are retrieved for the purpose of mapping the CSV column headers. |
File Value | This property can either be a ContentDocument ID, a Base64 encoded string, or a CSV string. When this property is provided, the file input is concealed and the component functions as a CSV mapper using the provided file value. |
Required Fields to Map | These are the Salesforce object fields that need to be mapped. |
Default Mappings | With "Default Mappings", you can pre-define how the columns in your CSV file correspond to the fields in the Salesforce object you're working with. This means you can set up a standard template or pattern of how data from the CSV should be interpreted and where it should be placed in your database. |
Hide Mapping | When this property is set, the mapping section is hidden and mapping is done automatically. |
Hide Sample Data | If set, the sample data displayed beneath the column name in the mapping section is hidden. |
Parser Option Properties
Name | Description |
---|---|
Comments | This represents a comment identifier (e.g., # or //). Any line in the CSV file starting with this string will be ignored during parsing. |
Delimiter | The character used to separate fields. If left blank, it will auto-detect from a list of common delimiters, or any values provided in |
Delimiters To Guess | An array of delimiters that the parser will choose from if the |
Encoding | Specifies the encoding to be used when opening local files. It must be a value supported by the FileReader API. Default is “UTF-8”. |
Escape Characters | The character used to escape the quote character within a field. Default is “"”. |
Fast Mode | This speeds up parsing significantly for large inputs. However, it only works when the input does not contain any quoted fields. Fast mode will automatically be enabled if no ” characters appear in the input. |
New Line | The sequence used to represent a new line. If left blank, it auto-detects. Must be one of , , or . |
Quote Characters | The character used to quote fields. Quoting of all fields is not required. Any unquoted field will be read correctly. Default is “"”. |
Last updated