One of 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.
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 breaking the data into batches automatically. 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 each 10,000 records in your job data internally.
Salesforce Connector Creates a Bulk API V2 operation is used to insert, update, delete or upsert the data.

Prerequisites:

• Installing salesforce connector(by login into anypoint exchange from 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)
• CSV file used to process data to salesforce should be UTF 8 format and can not be greater then 100 MB.
• Create 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 Bulk API 2.0 simplifies uploading large amounts of data by breaking the data into batches automatically. 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 an API-led connectivity and Integrate with other system like salesforce using different connectors.