One of the main use cases with Salesforce that MuleSoft customers use involves uploading records that are stored in CSV format to Salesforce. MuleSoft has provided various ways to fulfill this use case. We have dataloader.io, the most popular Data Loader for Salesforce on Salesforce AppExchange, and also have Anypoint Platform’s Salesforce Connector with various operations.
We added another option to help you easily accomplish the above use case.
Mulesoft Bulk API v2.0 is available in API version 41.0 and later. Compared to Bulk API v1.0, Salesforce has dramatically simplified the pre-processing step of Bulk API. In this blog, we will walk you through how to bulk upload your contact records in CSV format to Salesforce through Bulk API v2.0.
- Bulk API 2.0 provides a simple interface to quickly load large amounts of data into your Salesforce org and to perform bulk queries on your org data.
- Bulk API 2.0 simplifies uploading large amounts of data by automatically breaking the data into batches. All you have to do is upload a CSV file with your record data.
- We can process 100 million records per 24-hour period.
- Salesforce creates a separate batch for every 10,000 records in your job data internally.
- Salesforce Connector Creates a Bulk API V2 operation that is used to insert, update, delete or upsert the data.
Prerequisites:
- Installing salesforce connector(by login into any point exchange from the studio, you can install the salesforce connector)
- Salesforce developer account
- Security token
- Consumer key and secret(If you are using the Salesforce connector to access an OAuth API, you also need a consumer key and secret)
- The CSV file used to process data to salesforce should be in UTF 8 format and can not exceed 100 MB.
- Create a project in anypoint studio and configure the listener to trigger the flow
- Drag and drop create job bulk API v2 operation from mule palette
- Configure the file read operation to read the CSV file
Configure the below parameters for Create job bulk api v2 operation:
- ObjectType: type of the salesforce object
- sObjects: An array of one or more array objects(payload)
- Operation: operation to be invoked insert/update/delete/upsert
- Line ending: line ending of csv file, LF or CRLF
- Column delimiter: backquote (`), caret (^), comma, pipe (|), semicolon, and tab
- External Id field name: it only required for upsert operation
- Deploy the application and, trigger the flow, create the test data as a CSV file
We can check the status of the batch job after login into Salesforce.
In this way, MuleSoft Bulk API v2.0 simplifies uploading large amounts of data by automatically breaking the data into batches. We can process 100 million records per 24-hour period.
Perficient + MuleSoft
At Perficient, we excel in tactical MuleSoft implementations by helping you address the full spectrum of challenges with lasting solutions rather than relying on band-aid fixes. The end result is intelligent, multifunctional assets that reduce costs over time and equip your organization to proactively prepare for future integration demands.
We’re a Premier MuleSoft partner with more than 15 years of integration expertise across industries, including financial services, healthcare, retail, and more. After MuleSoft’s acquisition by Salesforce, our continued innovation in the integration space offers more customized experiences on software developed by MuleSoft. We combine the MuleSoft product suite with our connectivity expertise to provide comprehensive solutions both on-premises and in the cloud.
Contact us today to learn how we can help you develop API-led connectivity and Integrate with other systems like salesforce using different connectors.
Nice & Informative Blog.
Very informative, Great work Suraj!!
Very Informative .Keep it up !
Helpful Content. Nice blog Suraj.