Data Loader · Leads

Lead imports look like any other insert, right up until every Lead lands on the person who ran it, half the rows bounce for a blank Company, and Email Opt Out is nowhere in the mapping screen. Here is the prep that avoids all three.

2 requiredLast Name and Company for B2B Leads
01Q…the assignment rule ID that routes every Lead
Lead Statusas the column name, not Status
11‑minute videoThe full walkthrough
On this page
  1. The problem
  2. Prep 1 · Required fields
  3. Prep 2 · Assignment rule
  4. Prep 3 · Email Opt Out
  5. Prep 4 · Save the CSV
  6. Insert the Leads
  7. Check the results
  8. Gotchas and FAQ
Watch on YouTube ↗
The problem

Leads come with rules attached.

A Lead import isn’t just rows in. Required fields depend on B2B or B2C, the assignment rule decides who owns each Lead, and one field hides from Data Loader by default.

Leads arrive from everywhere: web forms, bought lists, trade show scans, the old CRM. The insert itself is quick. What causes trouble is the stuff around it: blank Company names, every Lead landing on the person who ran the load, and an Email Opt Out column that never shows up in the mapping screen.

Salesforce Data Loader set up to insert Lead records from a CSV file
Same Insert button as always. The prep is what’s different.

Prefer to read? Everything in the video is written out below.

Prep 1

Fill the required fields.

B2B Leads need Last Name and Company. B2C Leads in a Person Account org need Last Name.

ModelRequiredConverts to
B2BLast Name, CompanyAccount + Contact (+ Opportunity)
B2C (Person Accounts, e.g. FSC)Last NamePerson Account

Filter the Company and Last Name columns for blanks, and fill them with obvious placeholders: Unknown Company, Unknown Last Name. The rows load, and the placeholders are easy to find and clean up later. Give every row a Lead Status that exists in the new org.

Migrating history? Created By and Created Date can be loaded too, but only on insert and only with the Set Audit Fields upon Record Creation permission. Loading converted Leads? Those need five extra fields, on insert only.

Prep 2

Get the Lead Assignment Rule ID.

Paste the active rule’s ID into Data Loader’s settings, and each Lead is assigned by your rules instead of to you.

  1. In Data Loader click Export and tick Show all Salesforce objects.
  2. Pick Assignment Rule (it holds both Lead and Case rules), select all fields and finish.
  3. In the CSV, find the row with Active = TRUE and SobjectType = Lead. Copy its ID, which starts with 01Q.
  4. In Data Loader Settings, paste it into Assignment rule and click OK.

Using the assignment rule? Leave Owner ID out of the file. Only map Owner when you want to bypass the rules and put Leads on specific users.

Prep 3

Unhide Email Opt Out.

If Email Opt Out isn’t in Data Loader’s field list, it’s field-level security, not you.

  1. Object Manager → Lead → Email Opt Out → Set Field-Level Security.
  2. Make it visible and editable for the profile doing the load.
  3. Restart Data Loader, or log out and back in, so it picks up the change.
Prep 4

Save the CSV.

One last check, then save as CSV.

  • Company filled for B2B rows, Last Name on every row
  • Lead Status valid on every row
  • Required custom fields filled
  • No Owner column if you’re using the assignment rule

Save as CSV (Comma delimited) with a name you’ll recognise, like Leads_Prepared.csv.

The load

Insert the Leads.

Insert, Lead, your CSV, Auto-Match, review, run.

  1. Click Insert, choose Lead and browse to the CSV.
  2. Create or Edit a Map → Auto-Match Fields to Columns, then check every mapping. Headers that are API names make this quick.
  3. Pick an output folder and finish.

Name the column “Lead Status”, not “Status”. Data Loader’s success and error files add their own STATUS column. A source column called Status collides with it, and your original values get hard to read in the output.

After the load

Read both files, then spot-check.

The success file has the new Lead IDs (starting 00Q). The error file says why every failed row failed.

The most common error is a duplicate: a duplicate rule found a Lead with the same email, name or company. Tell the client it already exists, remove it from the file, or, only with the client’s OK, adjust the duplicate rule. Other usual suspects are in the Data Loader error codes post.

Paste both files into tabs in the workbook (Leads Prepared, Lead Success, Lead Errors). Then open several Leads from different parts of the file and check the fields, the Lead Status, any audit fields, and that the owner came from the assignment rule.

Gotchas

The questions people ask.

Insert or Upsert?
Insert creates new Leads. Upsert updates a match on ID or an External ID, and inserts the rest.
Every Lead was assigned to me
The assignment rule ID wasn’t set in Data Loader settings, or the rule isn’t active. Fix it, then reassign with an update or rerun the rules.
Email Opt Out isn’t in the field list
Field-level security. Make it visible and editable for your profile, then restart Data Loader.
Why did some rows fail?
Usually a missing Company or Last Name, a duplicate rule, an invalid Lead Status, or a validation rule. The error file says which.
Should I test first?
Yes. Run it in a sandbox or Developer Org to check the mapping, the assignment rule and the data before production.
Data Migration Masterclass

Leads are rarely the only object.

The Masterclass walks through the full migration in load order, including converted Leads, Campaigns and the activity history that hangs off them.

Know someone about to import a pile of Leads?

Share on LinkedIn
Doing this for a whole org, not just one object?

One CSV is a tutorial. Forty objects, 15 years of history and a go-live date is a project. That’s the part I do for a living.

See how I run migrations →