How to Have Csvs Automatically Uploaded Into Salesforce

This Post was most recently updated on:xi/29/21

Yous can now upload CSV data and turn it into Salesforce records with just a couple of Flow elements

This activity is based on original work by Narender Singh, plus nice new improvements by Hijlko and Suraj Pillai.

(Interested in exporting records to CSV? Check that out hither)

Hither's all that's needed to accept a typical CSV file and turn it into a collection of Accounts that yous can save or modify.

The work is done by the ConvertCSVToRecords invocable action. It takes equally input ane or more Content Certificate ID'southward. This is the main way you refer to files that have been uploaded to Salesforce. In the example higher up, nosotros utilise a File Upload screen component to upload a CSV file. (come across Considerations: Uploading Files, below for more information). It outputs a Content Certificate ID which is so fed into the new action.

The action takes reward of Flow back up for generic SObjects in invocable actions. This is the same enhancement that enables Drove Actions. Here, at design time, I specify both the name of the object type "Account" and you select Account as the wait output from the activity:

Considerations: Uploading Files

The video in this postal service shows an example that uses the out-of-the-box File Upload component. It requires a recordId to be provided, and it stores uploaded files 'on' that recordId. This makes a lot of sense when you're trying to upload Account or Contact-related files, just doesn't make a lot of sense hither where we're only trying to import data. As the video hither shows, I really created a separate object only to hold these values.The import process doesn't really make apply of this related record. This is all a little annoying. Fortunately, since that video was recorded members of the Flow community have created a replacement extension called File Upload Improved, which doesn't require a recordId. We recommend that for utilize with CSV Uploading.

CSV File Considerations

The start row of your file should consist of the field names you want to upload. Make sure you utilize apinames, include "__c" for your custom fields, and pay attending to the required fields for the records yous're uploading. Note: there should be no NULL values in the last column of CSV.

As of Version 1.2, the following things are supported:

Row Information Support

  • Text and Appointment fields
  • Embedded commas
  • Rows/File beginning and ending with quotes
  • Newline characters within columns
  • Zip columns at the stop of a row
  • Supports the CSV spec definition of double quotes, which is represented by consecutive double quotes ("") inside a column enclosed in double quotes:

Column Header Support

Column Headers should be in the get-go row of the file and should be api field names:

Column Headers that are not already field API names will exist converted to API Name format

Examples:
Purchase Amount => Purchase_Amount__c
Basics & Bolts => Nuts_Bolts__c

Back up for Not-US Separators

Correspondent Hijlko added this useful improvement. With it, you tin can import CSV files containing values that employ non-comma separators similar semicolons. Standard US csv uses a comma as a field separator while most European csv's use a semicolon as a field seperator.The code can at present import muli region CSV files
Numbers/currency similar 1,2345.56 (US) and i.234,56 (EU) are converted to 1234.56

You can now fix the following:

  • Field Separator
  • Thousand Separator
  • Decimal Separator
  • Currency Symbol

If these inputs are left empty, the existing default values will be used.

Back up for Non-Usa Dates

Date values in the formats YYYY-MM-DD and DD-MM-YYYY (or with non-hyphen separators like YYYY/MM/DD and DD/MM/YYYY) are now converted by default to YYYY-MM-DD, which is the Salesforce standard. You can prepare the Date Format input: The default is yyyy-MM-dd or the local date format. Other supported formats are dd-MM-yyyy and MM-dd-yyyy

Attributes

Inputs

Object API Proper noun Required. Tells Flow what to convert your data into. Case "Account". Make sure your CSV file has all the required fields
contentDocumentId A single Content Document record ID cord

contentDocumentIdList
Drove of Strings.
isTrim Set isTrim to true to have any leading or trailing spaces removed.
Appointment Format Date format used in the file. Default is yyyy-MM-dd or the local date format. Other supported formats are dd-MM-yyyy and MM-dd-yyyy
Separator 1: Fields The character that indicates a separation between ii fields. Defaults to a comma. European content oft uses a semi-colon
Separator 2: Decimals The character that distinguishes between the left side and right side of a value, such as 23.45. Defaults to flow.
Separator 3: Thousands The graphic symbol that distinguishes betwixt thousands, such as 230.454. Defaults to comma.
Separator 4: Currency

Output

A drove of Records

Install Package

Version 1.4.one 11/29 – bug fixes

  • Handles negative numbers.
  • Handles '1' and '0' for 'true' and 'false' respectively for boolean fields.

Erstwhile Versions

Version 1.4 Unlocked 11/2/21 Added Date Format input and fixed some bugs

i.3.two Unlocked 10/2/21

Version 1.3 Unlocked 9/3/21 Support for Not-U.s.a. Separators,Support for Non-Us Dates ,Additional Robustness in Handling Not-Alphabetical Characters

  • Production or Developer Version 1.1
  • Sandbox Version ane.i
  • Version 1.01 – 6/13/20 -removed consign files, as they have been obsoleted past this work.
  • Install Unmanaged v1.0 four/xix/20

View Source

Source

laforgemurper.blogspot.com

Source: https://unofficialsf.com/narender-singh-brings-csv-imports-to-flow/

0 Response to "How to Have Csvs Automatically Uploaded Into Salesforce"

Enregistrer un commentaire

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel