Data Loader · Accounts

Loading Accounts looks like the easy object. Then a company name gets silently chopped at 255 characters, every record lands with you as the owner, and the Created Dates are wrong forever. Here is the prep that gets you a clean run the first time.

1 required fieldAccount Name, 255 characters max
Insert onlyCreated By and Created Date can’t be fixed with an update later
2 waysto map record types: by Name or by ID
10‑minute videoThe full walkthrough, file to success file
On this page
  1. The problem
  2. Prep 1 · Account Name
  3. Prep 2 · API name headers
  4. Prep 3 · Owner and audit fields
  5. Prep 4 · Record types
  6. Prep 5 · Dates and the CSV
  7. Run the insert
  8. Check the success file
  9. Practice run
  10. Gotchas and FAQ
Watch on YouTube ↗
The problem

A successful load can still be wrong.

Data Loader saying “100% successes” means Salesforce accepted the rows. It doesn’t mean the rows are right.

The Account insert itself takes a minute. The rework comes from things nobody checked beforehand: names that were too long, owners that didn’t match, record types that resolved to the wrong object, dates in the wrong format. All of it is fixable in the spreadsheet before the load, and most of it is painful after.

Salesforce also won’t clean anything for you. Inconsistent casing, messy address lines and placeholder values come in exactly as they went out. If cleanup is in scope, agree that before you load thousands of rows.

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

Prep 1

Check Account Name length first.

Account Name is the only required field, and it has a 255-character limit. Go over it and Salesforce truncates the name without telling you which rows.

You find out months later, when someone notices a chopped company name. A LEN column in Excel finds them in a minute:

  1. Add a column called Name Length.
  2. In row 2, enter =LEN(A2), pointing at the Account Name cell.
  3. Fill it down, then filter for values greater than 255.
  4. Fix those names in the source, then delete the helper column before you export the CSV.
Prep 2

Use field API names as your headers.

When the CSV headers match the Account field API names, Data Loader’s Auto-Match maps them for you. Then you review the mapping instead of building it.

Labels can be renamed and can look alike. API names are unique on the object and don’t change: “Billing Street” is a label, BillingStreet is the target. More on why in Data Loader field mapping: API names, not labels, and here are the fastest ways to get the API names.

A workbook layout that works well: a Sample Accounts tab holding the raw extract (with the old system’s ID, its type field and the legacy user IDs), and an Accounts Mapped tab where the headers are API names and every transformation decision is applied. You export the mapped tab.

Prep 3

Decide Owner and audit fields now.

Leave Owner blank and every Account belongs to you. Leave Created By and Created Date blank and you can’t fix them later without deleting and re-importing.

  • Owner: if you don’t set it, Salesforce makes the loading user the owner. Annoying, but an update fixes it.
  • Created By and Created Date: these can only be set at insert, and only if the org has Set Audit Fields upon Record Creation enabled and your user has that permission. Miss them, and historical accuracy means delete and re-import.

For the user lookups you have two options. Pick one per run:

  • Salesforce User IDs in the Owner and Created By columns, or
  • a Legacy ID on User, marked as an External ID and loaded when you imported the Users.

With the Legacy ID approach, the CSV headers use the lookup syntax Owner:User-LegacyId__c and CreatedBy:User-LegacyId__c, and Data Loader’s Step 2b points both lookups at LegacyId__c.

Data Loader Step 2b with the CreatedBy and Owner lookups set to User LegacyId__c and circled, next to a spreadsheet using the headers Owner:User-LegacyId__c and CreatedBy:User-LegacyId__c
Step 2b on the left, the matching headers on the right. They have to agree, or nothing matches.

Two lookup failures to avoid: mixing Salesforce IDs and Legacy IDs for the same lookup in one run (Data Loader errors), and referencing a legacy user who was never loaded (the lookup can’t find the value). Load Users first, then check the IDs exist.

Prep 4

Map record types by Name or by ID.

Mapping by Name is quicker. Mapping by ID is safer when the same record type names exist on more than one object.

MethodStep 2b settingCSV column contains
By NameRecord Type lookup set to NameThe record type name, e.g. Business, Partner
By IDLeave Record Type unsetThe 18-character Record Type ID

The catch with Name: if both Account and Contact have a record type called Business, the lookup can resolve to the wrong one. Distinct names across objects, use Name. Repeated names, use ID. Decide before you build the CSV, because it changes both the column values and the Step 2b setting.

Parent Accounts: insert all the Accounts first, then run an update to set Parent Account once every parent has a Salesforce ID. Person Accounts need their own setup and aren’t covered here.

Prep 5

Format the dates, then export the CSV.

Created Date is a date-time field. Give it plain text or a mix of formats and you get failed rows or wrong timestamps.

  1. Apply one custom date-time format to the whole Created Date column, for example yyyy-mm-ddThh:mm:ss.
  2. Spot-check a few rows to confirm they show both the date and the time.
  3. Keep only the columns you intend to load, with API-name headers.
  4. Delete helper columns like Name Length.
  5. Save the mapped tab as a CSV. Data Loader can’t read an Excel tab directly.
The load

Run the insert.

With the file ready, the Data Loader part is quick. Most of the care goes into the mapping review.

  1. 1

    Start the insert

    Click Insert, choose Account and select your CSV.

  2. 2

    Set the lookups in Step 2b

    Created By and Owner to your Legacy ID field (if you used it), Record Type to Name (if you map by name). Your CSV values have to match what you pick here.

  3. 3

    Auto-Match, then review

    Check record type, the Legacy ID on Account, Owner and Created By (one method only), and that each address column lands in the Billing or Shipping field you expect. Nothing should sit unmapped by accident.

  4. 4

    Run it

    Pick an output folder and finish. Data Loader writes a success file with the new Salesforce IDs and an error file with the reason each failed row failed.

Rows in the error file? Here are the common Data Loader error codes and how to fix each one.

After the load

Treat the success file like a receipt.

Rename it, keep it, and use it to check a few records field by field.

  1. Rename the file with the object, date and environment so you can find it later.
  2. Paste the rows into a Success tab in your workbook.
  3. Open the first few new Account IDs in Salesforce and compare them with the source.

This is where you catch the quiet failures:

  • Record type: loaded, but not the one you meant
  • Owner: loaded as you, because the lookup didn’t match
  • Address: street in city, city in state
  • Created Date: off because of formatting

The success file is also what connects the old parent IDs to the new Salesforce IDs for the Parent Account update.

Practice

Run the whole thing in a Developer Org.

A free Developer Org is the cheapest place to make these mistakes.

  1. Create two Account record types: Business and Partner.
  2. Create a Legacy ID field on Account and mark it as an External ID.
  3. Build the Accounts Mapped tab with API-name headers and your lookup choices.
  4. Export the CSV, run the insert, and verify the results in Salesforce.

Once that runs clean twice in a row, you’re ready for Contacts.

Gotchas

The questions that come up every time.

What’s the minimum I need to insert an Account?
Just Account Name, under 255 characters. Use =LEN() in Excel to flag long ones before the load.
Every Account loaded with me as the owner
The Owner lookup didn’t match, so Salesforce defaulted to the loading user. Check that the Users were loaded first, that their Legacy IDs match your CSV, and that Step 2b points Owner at the right field. Then fix it with an update.
Can I fix Created Date after the load?
Not with a normal update. Audit fields can only be set on insert, so the fix is delete and re-import. Decide on them before the first run.
Should I map record types by Name or ID?
By Name if the names are unique across your objects, by ID if any name repeats (like Business on both Account and Contact).
Can I use both Salesforce IDs and Legacy IDs for Owner?
Not in the same run. Pick one method per lookup per load, or Data Loader errors.
Data Migration Masterclass

Accounts are object one of forty.

The Masterclass walks through the full migration in load order, with the workbooks and checks I use on real projects.

Know someone about to load their first batch of Accounts?

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 →