cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to search Salesforce records in bulk from a CSV file?

shaked
Deputy Chef I
Deputy Chef I

Hi,

I am reading records from a CSV file and I need to check whether each record already exists in Salesforce.

For each row in the CSV, I need to search a Salesforce object (for example, Contact) by a unique field such as Employee ID and retrieve the matching record.

Is there a way to perform this lookup for all CSV records in a single step using a bulk operation or any other approach?

Or do I have to iterate through each CSV row and execute a separate Salesforce search for each record?

The CSV may contain a large number of records, so I would like to avoid processing them one by one if possible.

Thanks!

1 REPLY 1

rajeshjanapati
Executive Chef II
Executive Chef II

Hi @shaked,
    Yes, there is an approach to achieve this without iterating through every CSV row and performing an individual Salesforce search.

You can accomplish this in just a few steps:

  1. Read your existing CSV file.

  2. Use the Salesforce action "Search Records in bulk using SOQL query (API 1.0)" to retrieve the existing records from the Salesforce object. The output will be in CSV format.

  3. Use SQL Transformations by Workato to compare the CSV data with the Salesforce data. Add both datasets as sources, write the required SQL query (for example Email_ID), and identify matching or non-matching records in a single operation.

This approach avoids executing a separate Salesforce search for every CSV record. Instead, you can retrieve the Salesforce data at once and perform the comparison using SQL, which is much more efficient for large datasets.

The final output can be returned as CSV file contents or written directly to File Storage, depending on your requirements.

I hope this helps. Please refer to the attached screenshots for the workflow configuration.Screenshot 2026-07-12 151329.pngScreenshot 2026-07-12 152919.pngScreenshot 2026-07-12 153029.png


Thanks,
J Rajesh Kumar.