Part 33: Mass Updating Data in Salesforce
Day-to-day Salesforce administration is not all about building flows and configuring page layouts. A huge part of the job involves data operations — cleaning up stale records, transferring ownership during team restructures, fixing addresses after a company moves offices, importing leads from a trade show, or purging test data from a sandbox. Salesforce gives you a suite of built-in tools for exactly these tasks, ranging from simple point-and-click wizards inside Setup to the powerful Data Loader desktop application.
In this post we will walk through every mass data tool available to administrators: Mass Delete, Mass Transfer Records, Mass Transfer Approval Requests, Mass Reassign Account Teams, Mass Reassign Opportunity Teams, Mass Update Addresses, the Data Import Wizard, and the Data Loader. For each tool you will learn where to find it, when to use it, how it works step by step, and what its limitations are. By the end you will know exactly which tool to reach for in any bulk data scenario.
Why Mass Data Operations Matter
Before we dive into the tools, let’s understand why this topic deserves its own post.
Common Scenarios
| Scenario | What Needs to Happen | Best Tool |
|---|---|---|
| Sales rep leaves the company | Transfer all their accounts, contacts, opportunities, and cases to a new owner | Mass Transfer Records |
| Marketing imports 10,000 trade show leads | Insert new Lead records in bulk | Data Import Wizard or Data Loader |
| Duplicate cleanup identifies 3,000 junk accounts | Delete records in bulk | Mass Delete or Data Loader |
| Company relocates headquarters | Update billing/shipping addresses on thousands of accounts | Mass Update Addresses |
| A VP is promoted and their account team shifts | Reassign account team members across many accounts | Mass Reassign Account Teams |
| End-of-quarter pipeline cleanup | Update fields on thousands of opportunities | Data Loader (Update) |
| Sandbox refresh left behind test data | Purge records that should not exist in production | Mass Delete or Data Loader |
| A manager goes on leave with 50 pending approvals | Transfer approval requests to another approver | Mass Transfer Approval Requests |
Each of these scenarios would be painful to handle one record at a time. The tools in this post make them manageable.
The Golden Rule of Mass Data Operations
Always test in a sandbox first. Mass operations are difficult or impossible to undo. A mass delete of 5,000 records sends them to the Recycle Bin, but the Recycle Bin has storage limits. A mass transfer changes ownership and can trigger assignment rules, sharing recalculations, and workflow rules. A Data Loader update with a bad CSV can overwrite good data with blank values. Test every mass operation in a sandbox or developer edition before running it in production.
Mass Delete
Mass Delete is the simplest bulk deletion tool in Salesforce. It lives inside Setup and lets you delete records that match criteria you define — no CSV file, no external tools, no code.
Where to Find It
Setup > Data > Mass Delete Records
You will see links for the objects that support Mass Delete:
- Mass Delete Accounts
- Mass Delete Activities
- Mass Delete Cases
- Mass Delete Contacts
- Mass Delete Leads
- Mass Delete Products
- Mass Delete Reports
- Mass Delete Solutions
Step-by-Step: Mass Deleting Leads
Let’s walk through a practical example — deleting all leads with a status of “Disqualified” that were created more than a year ago.
- Navigate to Setup > Data > Mass Delete Records.
- Click Mass Delete Leads.
- You will see a filter interface with up to five criteria rows. Set your filters:
- Lead Status equals Disqualified
- Created Date less than 03/18/2025 (one year ago)
- Click Search.
- Salesforce displays matching records in a paginated list. Review them carefully.
- You can select individual records using checkboxes, or check the Select All box at the top to select all records on the current page.
- Optionally, check Permanently delete the selected records if you want to bypass the Recycle Bin. Use this with extreme caution — there is no undo.
- Click Delete.
- Salesforce processes the deletion. If the number of records is large, it may take a moment.
What Happens Behind the Scenes
- Deleted records go to the Recycle Bin by default (unless you checked the permanent delete option).
- The Recycle Bin holds records for 15 days before they are permanently purged.
- Each user’s Recycle Bin can hold up to 25 times their MB storage allocation worth of records.
- Related child records may also be deleted depending on the relationship type. For example, deleting an Account will cascade-delete its Contacts, Opportunities, and Cases if those relationships are master-detail or if the account is the parent.
- Mass Delete respects validation rules, triggers, and sharing rules. If a validation rule prevents deletion of certain records, those records will be skipped and an error message will appear.
Limitations of Mass Delete
| Limitation | Details |
|---|---|
| Limited objects | Only supports the eight objects listed above. You cannot mass-delete custom object records this way. |
| Filter constraints | Maximum of five filter criteria. Complex filtering is not possible. |
| Page-by-page selection | You must select records page by page. There is no “select all matching records across all pages” button. |
| No scheduling | You cannot schedule a mass delete to run at a future time. |
| Trigger execution | Apex triggers fire on each deleted record, which can cause performance issues or governor limit errors on very large sets. |
| Profile permission required | The user must have the “Modify All Data” permission to access Mass Delete. |
When to Use Mass Delete
Use Mass Delete when:
- You need to delete records from one of the eight supported objects.
- The number of records is manageable (a few hundred to a few thousand).
- You can define the target records with simple filter criteria.
- You want a quick, no-setup solution that does not require a CSV file.
For anything more complex — custom objects, more than five filter criteria, tens of thousands of records, or scheduled operations — use the Data Loader instead.
Mass Transfer Records
Mass Transfer Records lets you change the owner of multiple records at once. This is one of the most frequently used mass tools because ownership changes are a constant reality in any organization — reps leave, territories get realigned, managers take over accounts.
Where to Find It
Setup > Data > Mass Transfer Records
You will see options for:
- Mass Transfer Accounts
- Mass Transfer Leads
- Mass Transfer Service Contracts
- Mass Transfer Custom Object Records (available for custom objects with an Owner field)
Step-by-Step: Mass Transferring Accounts
Let’s say a sales rep named Jordan Lee has left the company and you need to transfer all of Jordan’s accounts to a new rep named Morgan Chen.
- Navigate to Setup > Data > Mass Transfer Records.
- Click Transfer Accounts.
- In the Transfer From field, use the lookup to select Jordan Lee.
- In the Transfer To field, select Morgan Chen.
- Optionally, add filter criteria to narrow down which records to transfer. For example:
- Account Type equals Customer (if you only want to transfer customer accounts, not prospects).
- Configure the transfer options:
- Transfer open opportunities owned by the existing account owner — Check this if you also want to move Jordan’s open opportunities to Morgan.
- Transfer closed opportunities owned by the existing account owner — Usually left unchecked. Closed deals should typically stay with the original owner for historical reporting.
- Transfer open cases owned by the existing account owner — Check this to reassign open support cases.
- Transfer closed cases owned by the existing account owner — Usually left unchecked.
- Keep the existing account team — Check this if the rest of the account team should remain in place. Uncheck if you want the team cleared out.
- Keep the existing opportunity team on open opportunities — Same logic as above.
- Click Find.
- Salesforce displays matching accounts. Review the list.
- Select the records you want to transfer (or use Select All on the current page).
- Click Transfer.
What Happens Behind the Scenes
- Ownership changes on the Account cascade to related records depending on the options you selected.
- Sharing recalculation fires after the transfer. If your org has complex sharing rules, role hierarchies, or territory management, this can take time.
- Assignment rules do not fire during mass transfer — the records go directly to the specified new owner.
- Workflow rules and Apex triggers that fire on ownership change will execute.
- Field history tracking records the ownership change.
Transferring Leads
Mass Transfer for Leads works similarly but has fewer related-record options since Leads are standalone records (they do not have child opportunities or cases). The primary use case is territory realignment — when a marketing territory changes and all leads in a specific state or country need to move to a different rep.
Transferring Custom Object Records
If you have a custom object with an Owner field (as opposed to a master-detail relationship), you can use Mass Transfer to change ownership in bulk. The interface is the same — specify a Transfer From user, a Transfer To user, optionally filter, and transfer.
Limitations of Mass Transfer Records
| Limitation | Details |
|---|---|
| One-to-one transfer | You transfer from one specific owner to one specific new owner. You cannot redistribute records across multiple new owners in a single operation. |
| Page-by-page selection | Same as Mass Delete — no “select all across all pages” option. |
| Trigger execution | Ownership-change triggers fire on each record. Watch for governor limits. |
| Sharing recalculation | Large transfers can cause significant sharing recalculation time. Plan transfers during off-peak hours. |
| No scheduling | Cannot be scheduled. Must be run manually. |
When to Use Mass Transfer Records
Use Mass Transfer Records when:
- A user is leaving the organization and their records need a new owner.
- Territories are being realigned and records need to shift between reps.
- You need to move records between owners along with related child records (opportunities, cases).
- The number of records is moderate (hundreds to low thousands).
For very large transfers (tens of thousands of records) or complex multi-owner redistribution, consider using the Data Loader to update the OwnerId field directly via CSV.
Mass Transfer Approval Requests
When an approver goes on leave or changes roles, any pending approval requests assigned to them are stuck. Mass Transfer Approval Requests lets you move those pending approvals to a different user so that business processes keep moving.
Where to Find It
Setup > Data > Mass Transfer Approval Requests
Step-by-Step
- Navigate to Setup > Data > Mass Transfer Approval Requests.
- In the Transfer From field, select the current approver (the person who is unavailable).
- In the Transfer To field, select the new approver.
- Optionally filter by:
- Object Type — Limit to approvals on a specific object (Opportunity, Discount Request, etc.).
- Date Range — Limit to approvals submitted within a specific date window.
- Click Find.
- Review the list of pending approval requests.
- Select the requests you want to transfer.
- Click Transfer.
Key Details
- Only pending approval requests can be transferred. Requests that have already been approved or rejected are not affected.
- The transfer moves the approval step assignment, not the record itself. The record’s owner does not change.
- This tool is essential for organizations with strict SLAs around approval turnaround times. If an approver is out sick and 20 discount approvals are waiting, this tool prevents a bottleneck.
Mass Reassign Account Teams
Account Teams let you associate multiple users with an Account — a sales engineer, a customer success manager, an executive sponsor, etc. When team members change roles or leave the company, you need to update those team memberships across many accounts at once.
Where to Find It
Setup > Data > Mass Reassign Account Teams
Step-by-Step
- Navigate to Setup > Data > Mass Reassign Account Teams.
- In the Existing Team Member field, select the user who is being removed or replaced.
- Choose one of the following actions:
- Add a new team member — Adds a new user to all accounts where the existing member is found, without removing the existing member.
- Replace existing team member with a new team member — Swaps the old member for a new one.
- Remove existing team member — Removes the existing member from all accounts where they appear.
- If adding or replacing, specify:
- New Team Member — The user who will be added.
- Team Role — The role the new member will play (e.g., Sales Engineer, Executive Sponsor).
- Account Access — The level of access the new member gets (Read Only, Read/Write).
- Opportunity Access — Access level for opportunities on those accounts.
- Case Access — Access level for cases on those accounts.
- Optionally filter by account criteria (e.g., only accounts in a specific region).
- Click Find.
- Review and select the accounts to update.
- Click Reassign (or Add / Remove depending on the action).
Why This Matters
Without this tool, you would need to open every single account record, navigate to the Account Team related list, and manually update the team member. For an organization with hundreds of accounts, that could take hours. Mass Reassign Account Teams does it in minutes.
Limitations
- Only works with Account Teams. If your org uses custom team-like junction objects, this tool will not help.
- Requires the Account Teams feature to be enabled in the org.
- Page-by-page selection applies (same as other mass tools).
Mass Reassign Opportunity Teams
Opportunity Teams work similarly to Account Teams but at the Opportunity level. They track who is involved in each deal — the primary sales rep, the overlay rep, the presales consultant, etc.
Where to Find It
Setup > Data > Mass Reassign Opportunity Teams
Step-by-Step
The process mirrors Mass Reassign Account Teams:
- Navigate to Setup > Data > Mass Reassign Opportunity Teams.
- Select the Existing Team Member to replace or remove.
- Choose your action: Add, Replace, or Remove.
- If adding or replacing, specify the new team member, their team role, and their opportunity access level.
- Optionally filter by opportunity criteria (e.g., only open opportunities, only opportunities in a specific stage).
- Click Find.
- Review and select the opportunities to update.
- Click Reassign.
Key Differences from Account Teams
| Aspect | Account Teams | Opportunity Teams |
|---|---|---|
| Scope | Associated with Account records | Associated with Opportunity records |
| Access levels | Account, Opportunity, and Case access | Opportunity access only |
| Splits | Not applicable | Opportunity Splits can be tied to team members for revenue attribution |
| Default teams | Users can set a default account team | Users can set a default opportunity team |
When Opportunity Splits Are Involved
If your org uses Opportunity Splits (which divide credit for a deal among team members), reassigning opportunity team members can affect split percentages. After a mass reassignment, review the splits on affected opportunities to make sure revenue attribution is still correct.
Mass Update Addresses
Mass Update Addresses is a less well-known but very useful tool. It lets you update the billing and/or shipping address on multiple Account records at once. The classic use case is a company acquisition or office relocation where hundreds of accounts need their address updated.
Where to Find It
Setup > Data > Mass Update Addresses
Step-by-Step
- Navigate to Setup > Data > Mass Update Addresses.
- Define your filter criteria to find the accounts that need updating. For example:
- Billing City equals San Francisco
- Billing State equals CA
- Click Search to find matching accounts.
- Specify the new address values:
- New Billing Street
- New Billing City
- New Billing State/Province
- New Billing Zip/Postal Code
- New Billing Country
- You can update Shipping Address fields as well, or check the option to copy billing address to shipping address.
- Select the accounts to update.
- Click Update.
When to Use It
- A customer’s corporate headquarters moves and you need to update the address on all related accounts.
- Data cleanup reveals inconsistent city names (e.g., “SF” vs. “San Francisco”) and you want to standardize.
- A merger or acquisition changes the address for an entire portfolio of accounts.
Limitations
- Only works on Account addresses (billing and shipping). It does not update Contact mailing addresses.
- Limited filter criteria (same five-criteria maximum as other mass tools).
- For Contact address updates, use the Data Loader or a Flow.
The Data Import Wizard
The Data Import Wizard is Salesforce’s built-in, browser-based tool for importing data from CSV files. It supports a limited set of objects but provides a guided, user-friendly experience that does not require installing any software.
Where to Find It
Setup > Data > Data Import Wizard (or search “Data Import” in the Quick Find box)
Supported Objects
The Data Import Wizard supports the following standard objects:
| Object | Notes |
|---|---|
| Accounts and Contacts | Can be imported together in a single operation |
| Leads | Most common use case for the wizard |
| Solutions | Legacy object; rarely used in modern orgs |
| Campaign Members | Add contacts or leads to campaigns |
| Custom Objects | Any custom object is supported |
Not supported: Opportunities, Cases, Products, Price Book Entries, Tasks, Events, and most other standard objects. For those, use the Data Loader.
Step-by-Step: Importing Leads
- Navigate to Setup > Data > Data Import Wizard.
- Click Launch Wizard.
- Select the object type: Leads.
- Choose the operation:
- Add new records — Inserts new leads. Duplicates are matched by email address (configurable).
- Update existing records — Updates leads that already exist in Salesforce. Matched by Salesforce ID or email.
- Add new and update existing records — An upsert operation. New records are inserted, existing matches are updated.
- Choose the matching criteria:
- Email — Match by the lead’s email address.
- Salesforce ID — Match by the record’s 15- or 18-character ID.
- Name — Match by first and last name (less reliable due to duplicates).
- Choose how to handle duplicates:
- Skip duplicates.
- Update duplicates with imported data.
- Upload your CSV file. The file should have headers that correspond to Salesforce field API names or labels.
- The wizard displays a field mapping screen. Map each CSV column to a Salesforce field. The wizard auto-maps columns with matching names and lets you manually map the rest.
- Review the mapping summary.
- Click Start Import.
- The import runs asynchronously. You will receive an email notification when it completes, with a summary of successes and failures.
CSV File Preparation Tips
| Tip | Why |
|---|---|
| Use UTF-8 encoding | Prevents character encoding issues with special characters and international names |
| Include column headers | The wizard uses headers for auto-mapping. Headerless files cannot be mapped. |
| Keep files under 50 MB | The wizard has a 50 MB file size limit |
| Keep records under 50,000 | The wizard supports a maximum of 50,000 records per import |
| Remove formulas | Export CSVs from Excel as “CSV UTF-8” to strip formulas |
| Clean up blank rows | Trailing blank rows in the CSV create empty records |
| Validate required fields | Make sure every row has values for required fields (e.g., Last Name for Leads) |
| Use Salesforce IDs for updates | When updating records, include the Salesforce Record ID for reliable matching |
Limitations of the Data Import Wizard
| Limitation | Details |
|---|---|
| Object support | Does not support Opportunities, Cases, Products, Events, Tasks, or many standard objects |
| Record limit | Maximum 50,000 records per import |
| File size | Maximum 50 MB per CSV file |
| No delete operation | Cannot delete records. For bulk deletes, use Data Loader. |
| No export | Cannot export data from Salesforce. One-way import only. |
| No scheduling | Imports cannot be scheduled or automated |
| No relationship linking for all objects | Some relationship fields cannot be mapped through the wizard |
When to Use the Data Import Wizard
Use the Data Import Wizard when:
- You are importing Leads, Accounts/Contacts, Solutions, Campaign Members, or custom object records.
- The import volume is under 50,000 records.
- You want a guided, browser-based experience with no software installation.
- The operation is a one-time or occasional import (not a recurring automated job).
The Data Loader
The Data Loader is Salesforce’s most powerful bulk data tool. It is a desktop application (available for Windows and macOS) that can insert, update, upsert, delete, hard delete, and export records for any Salesforce object — standard or custom — with support for up to 5 million records per operation.
Every serious Salesforce administrator needs to know the Data Loader inside and out. It is the tool you will reach for most often for complex data operations.
Where to Get It
Setup > Data > Data Loader — Click the download link to get the installer for your operating system.
Alternatively, you can download it from the Salesforce Data Loader GitHub repository, which hosts the open-source version.
GUI vs. CLI
The Data Loader has two modes:
| Mode | Best For | Details |
|---|---|---|
| GUI (Graphical User Interface) | Interactive, one-time operations | Point-and-click interface. Select an operation, choose an object, upload a CSV, map fields, and run. |
| CLI (Command Line Interface) | Automated, scheduled, recurring operations | Driven by configuration files and command-line parameters. Can be integrated into scripts, cron jobs, and CI/CD pipelines. |
Most administrators use the GUI for day-to-day tasks and set up the CLI for recurring automated jobs (like nightly data syncs).
Data Loader Operations
The Data Loader supports six core operations:
1. Insert
What it does: Creates new records in Salesforce.
When to use: You have a CSV of records that do not yet exist in Salesforce and you want to create them.
How it works:
- Open Data Loader and click Insert.
- Log in to your Salesforce org (production or sandbox).
- Select the target object (e.g., Account, Lead, Opportunity, Custom_Object__c).
- Upload your CSV file.
- Map CSV columns to Salesforce fields using the field mapping screen. You can auto-map (matches by API name) or manually map each column.
- Click Finish to start the operation.
- Data Loader processes the records in batches (default batch size is 200 records).
- When complete, Data Loader generates two output files:
- Success file — Contains successfully inserted records with their new Salesforce IDs.
- Error file — Contains records that failed, along with error messages explaining why.
Key point: Always save the success file. It contains the newly created Salesforce IDs, which you will need if you later want to update or delete those records.
2. Update
What it does: Modifies existing records in Salesforce.
When to use: You need to change field values on records that already exist. Your CSV must include the Salesforce Record ID for each record.
How it works:
- Click Update in Data Loader.
- Select the target object.
- Upload your CSV. The CSV must include a column with the Salesforce Record ID (the 15- or 18-character ID).
- Map the ID column to the Id field. Map other columns to the fields you want to update.
- Click Finish.
- Records are matched by ID and updated with the values in the CSV.
Important: If a field in your CSV is blank, Data Loader will overwrite the existing value in Salesforce with a blank value. This is one of the most common mistakes — accidentally blanking out data. To avoid this, only include columns in your CSV for fields you actually want to change.
3. Upsert
What it does: Combines Insert and Update. If a matching record is found, it updates it. If no match is found, it inserts a new record.
When to use: You have a CSV that may contain a mix of new and existing records, and you want Salesforce to figure out which is which.
How it works:
- Click Upsert in Data Loader.
- Select the target object.
- Choose the External ID field that Data Loader will use for matching. This must be a field marked as an External ID on the object. If no External ID fields exist, you can also use the standard Salesforce ID.
- Upload your CSV.
- Map columns, including the External ID column.
- Click Finish.
- For each row, Data Loader checks if a record exists with a matching External ID value:
- If a match is found: the record is updated.
- If no match is found: a new record is inserted.
- If multiple matches are found: the row is rejected with an error.
Why External IDs matter: External IDs are custom fields with the “External ID” attribute checked. They are typically used to store identifiers from external systems (ERP IDs, legacy system IDs, etc.). Upsert relies on these fields to determine whether a record already exists.
4. Delete
What it does: Deletes records from Salesforce and sends them to the Recycle Bin.
When to use: You have a list of Salesforce Record IDs that need to be removed.
How it works:
- Click Delete in Data Loader.
- Select the target object.
- Upload a CSV that contains the Salesforce Record IDs of the records to delete.
- Map the ID column to the Id field.
- Click Finish.
- Records are deleted and moved to the Recycle Bin.
Tip: Before deleting, always export the records first (using Data Loader Export) so you have a backup in case you need to restore them.
5. Hard Delete
What it does: Permanently deletes records, bypassing the Recycle Bin entirely.
When to use: You are purging data that you are absolutely certain you will never need again (e.g., test data in a sandbox, data from a decommissioned integration).
Requirements:
- The Bulk API Hard Delete permission must be enabled for the user’s profile.
- This operation cannot be undone. There is no recovery once records are hard-deleted.
How it works: Same as Delete, but the records skip the Recycle Bin entirely. Use with extreme caution.
6. Export and Export All
What it does: Extracts records from Salesforce into a CSV file.
Two variants:
- Export — Exports only active (non-deleted) records.
- Export All — Exports both active records and records in the Recycle Bin (soft-deleted records).
How it works:
- Click Export (or Export All) in Data Loader.
- Select the source object.
- Write a SOQL query to define which records and fields to extract. For example:
SELECT Id, Name, Industry, BillingCity, OwnerId FROM Account WHERE Industry = 'Technology' - Click Finish.
- Data Loader executes the query and writes the results to a CSV file at the location you specify.
Tip: If you are not comfortable writing SOQL, the Data Loader’s query builder provides a point-and-click interface for selecting fields and adding filter conditions.
Data Loader Settings
Data Loader has several configurable settings that affect performance and behavior:
| Setting | Default | Description |
|---|---|---|
| Batch Size | 200 | Number of records processed per API call. Can be set from 1 to 200 (SOAP API) or up to 10,000 (Bulk API). |
| Use Bulk API | Off | When enabled, uses the Bulk API instead of the SOAP API. Recommended for large volumes (more than 10,000 records). |
| Use Serial Mode | Off | When enabled with Bulk API, processes batches sequentially instead of in parallel. Useful for avoiding lock contention on shared data. |
| Insert Null Values | Off | When enabled, blank fields in the CSV will overwrite existing values in Salesforce with null. When off, blank fields are ignored. |
| Time Zone | System default | The time zone used for date/time field mapping. |
| Proxy Settings | None | Configure if your network requires a proxy server to reach the internet. |
SOAP API vs. Bulk API
| Aspect | SOAP API | Bulk API |
|---|---|---|
| Best for | Small to medium volumes (under 10,000 records) | Large volumes (10,000 to 5 million records) |
| Processing model | Synchronous — each batch is processed immediately and results are returned | Asynchronous — batches are queued and processed by the server in the background |
| Batch size | Up to 200 records per batch | Up to 10,000 records per batch |
| Concurrency | Batches sent one at a time from the client | Server processes multiple batches in parallel (unless serial mode is enabled) |
| Speed | Slower for large volumes | Significantly faster for large volumes |
| Governor limits | Standard API limits apply | Bulk API has its own set of limits (daily batch limit, daily record limit) |
Using the Data Loader CLI
The CLI mode is powerful for automating recurring data operations. Here is how to set it up:
Configuration Files
The CLI uses two key files:
- process-conf.xml — Defines the operation (insert, update, delete, etc.), the target object, the CSV file path, the field mapping file path, and other operation parameters.
- Field mapping file (.sdl) — Maps CSV column names to Salesforce field API names.
Example: Automated Nightly Account Export
Here is a simplified workflow for setting up a nightly export of Account records:
- Create a process-conf.xml entry that defines:
- Operation: Extract
- Object: Account
- SOQL query: the fields and filters you want
- Output file path: where the CSV will be saved
- Create the .sdl mapping file (for exports, this is usually auto-generated).
- Create a shell script (macOS/Linux) or batch file (Windows) that invokes the Data Loader CLI with the process name.
- Schedule the script using cron (macOS/Linux) or Task Scheduler (Windows).
CLI Benefits
- Automation: No manual intervention required. Operations run on a schedule.
- Reproducibility: Configuration files serve as documentation of exactly what the operation does.
- Integration: Can be incorporated into larger ETL (Extract, Transform, Load) pipelines.
- Auditability: Logs and success/error files provide a complete audit trail.
Data Loader Best Practices
Here is a comprehensive list of best practices for Data Loader operations:
Before the Operation
- Export a backup. Before any update or delete operation, export the records you are about to modify. This gives you a rollback path.
- Validate your CSV. Open the CSV in a text editor (not just Excel) to check for encoding issues, trailing commas, extra columns, or misaligned rows.
- Check required fields. Ensure your CSV includes values for all required fields on the target object. Missing required fields will cause row-level failures.
- Verify record IDs. For update and delete operations, double-check that your ID column contains valid 15- or 18-character Salesforce IDs.
- Test in a sandbox. Always run the operation in a sandbox first to catch errors before they affect production data.
- Check automation impact. Consider what flows, triggers, workflow rules, and validation rules will fire. Disable non-essential automation temporarily if needed.
- Review sharing implications. Ownership changes trigger sharing recalculation. Plan large ownership updates during off-peak hours.
During the Operation
- Use Bulk API for large volumes. If you are processing more than 10,000 records, enable Bulk API in Data Loader settings.
- Use Serial Mode when needed. If you are updating parent and child records, or records that share lookup relationships, serial mode prevents lock contention errors.
- Monitor batch progress. Watch the Data Loader progress bar and check for errors in real time.
- Keep batch sizes reasonable. For SOAP API, 200 is the maximum and default. For Bulk API, start with 5,000 and adjust based on performance.
After the Operation
- Review the success file. Confirm the expected number of records were processed.
- Review the error file. Investigate every error. Common causes include validation rule failures, required field violations, duplicate rule blocks, and trigger exceptions.
- Spot-check records in Salesforce. Open a few records in the UI to verify the data looks correct.
- Re-enable automation. If you temporarily disabled triggers or validation rules, re-enable them immediately.
- Communicate with stakeholders. Let users know the data operation is complete, especially if it involved ownership changes or record deletions.
Data Loader Limitations
| Limitation | Details |
|---|---|
| Desktop installation required | Data Loader must be installed on a computer. It is not a browser-based tool. |
| No native scheduling in GUI | The GUI mode does not support scheduling. You must use the CLI with an external scheduler. |
| 5 million record limit | Maximum of 5 million records per operation. For larger volumes, split the CSV into multiple files. |
| API call consumption | Each batch consumes an API call. Large operations can deplete your org’s daily API limit. Monitor usage in Setup > Company Information. |
| No transformation | Data Loader does not transform data. You must prepare your CSV with the exact values you want in Salesforce. Use Excel, a script, or an ETL tool for transformations before loading. |
| Relationship handling | To set lookup or master-detail relationships, you must include the related record’s Salesforce ID (or External ID for upsert) in your CSV. |
Choosing the Right Tool
With all these tools available, how do you decide which one to use? Here is a decision framework:
Quick Reference Matrix
| Criteria | Mass Delete | Mass Transfer | Data Import Wizard | Data Loader |
|---|---|---|---|---|
| Operation | Delete only | Transfer ownership only | Insert, Update, Upsert | Insert, Update, Upsert, Delete, Hard Delete, Export |
| Objects supported | 8 standard objects | Accounts, Leads, Service Contracts, Custom Objects | Leads, Accounts/Contacts, Solutions, Campaign Members, Custom Objects | All standard and custom objects |
| Max records | No hard limit (page-by-page) | No hard limit (page-by-page) | 50,000 | 5,000,000 |
| Requires CSV | No | No | Yes | Yes |
| Requires installation | No (browser-based) | No (browser-based) | No (browser-based) | Yes (desktop app) |
| Can be automated | No | No | No | Yes (CLI mode) |
| Skill level | Beginner | Beginner | Beginner | Intermediate |
| Export capability | No | No | No | Yes |
Decision Flowchart
Ask yourself these questions in order:
-
Do I need to delete records?
- If the object is one of the eight supported by Mass Delete and the volume is small: Mass Delete.
- Otherwise: Data Loader (Delete).
-
Do I need to change record ownership?
- If the transfer is from one user to one other user and involves Accounts, Leads, or Custom Objects: Mass Transfer Records.
- If the redistribution is complex (multiple new owners, conditional logic): Data Loader (Update on OwnerId).
-
Do I need to import new records?
- If the object is supported by the Data Import Wizard and volume is under 50,000: Data Import Wizard.
- If the object is not supported or volume exceeds 50,000: Data Loader (Insert).
-
Do I need to update existing records?
- If the update is a simple address change on Accounts: Mass Update Addresses.
- For anything else: Data Loader (Update or Upsert).
-
Do I need to export data?
- Data Loader (Export) is the only built-in tool for this. (You can also use Report Export for smaller datasets.)
-
Does the operation need to run automatically on a schedule?
- Data Loader CLI is the only built-in option that supports scheduling.
Common Mistakes and How to Avoid Them
Mistake 1: Overwriting Data with Blank Values
What happens: You create an update CSV with 20 columns but only want to change two fields. The other 18 columns are blank. Data Loader updates all 20 fields, overwriting existing data with blanks.
How to avoid: Only include the ID column and the specific columns you want to update. Remove all other columns from the CSV.
Mistake 2: Forgetting to Disable Automation
What happens: You insert 50,000 Lead records. Each insert triggers a Flow that sends a welcome email. You just sent 50,000 emails.
How to avoid: Before large inserts or updates, review active Flows, Triggers, and Workflow Rules. Deactivate non-essential automation, run the data operation, then reactivate.
Mistake 3: Using the Wrong API
What happens: You try to insert 200,000 records using the SOAP API (batch size 200). Data Loader makes 1,000 API calls, takes hours, and may hit the daily API limit.
How to avoid: Enable Bulk API for any operation over 10,000 records. Bulk API processes batches of up to 10,000 records and is dramatically faster.
Mistake 4: Not Saving the Success File
What happens: You insert 10,000 records, close Data Loader, and later realize you need to update those records. But you do not have their Salesforce IDs because you did not save the success file.
How to avoid: Always save the success file to a known location. Name it descriptively (e.g., 2026-03-18_lead_insert_success.csv).
Mistake 5: Running in Production Without Testing
What happens: Your CSV has a formatting issue in row 5,001. The first 5,000 records load fine, but rows 5,001 onward fail. Now you have a partial load in production and need to figure out which records were created and which were not.
How to avoid: Always run the full operation in a sandbox first. Verify the results. Fix any issues. Then repeat in production with confidence.
Mistake 6: Ignoring Record Locking
What happens: You run a parallel Bulk API update that touches 100,000 Opportunity records. Multiple batches try to update Opportunities on the same Account simultaneously, causing lock contention and batch failures.
How to avoid: Sort your CSV by the parent record (e.g., AccountId for Opportunities) so that related records end up in the same batch. Alternatively, enable Serial Mode to process batches one at a time.
Third-Party Alternatives
While this post focuses on built-in Salesforce tools, it is worth knowing that several third-party tools exist for bulk data operations:
| Tool | Key Advantage |
|---|---|
| Dataloader.io | Browser-based Data Loader alternative. No installation required. Supports scheduling. Free tier available. |
| Jitterbit | Enterprise ETL tool with native Salesforce connectors. Supports complex transformations. |
| Informatica Cloud | Salesforce’s recommended enterprise integration platform. |
| MuleSoft | API-led integration platform (owned by Salesforce). Designed for complex multi-system integrations. |
| DemandTools | Specialized data quality tool for Salesforce. Strong duplicate management and mass-update capabilities. |
| Apsona | Browser-based tool for multi-object data operations with a spreadsheet-like interface. |
These tools do not replace the need to understand Salesforce’s built-in tools. The exam will test you on Data Loader and Data Import Wizard, and your org may not have a budget for third-party licenses. But in enterprise environments, these tools can save significant time on complex, recurring data operations.
Permissions Required
A quick reference for which permissions are needed for each mass data tool:
| Tool | Required Permission |
|---|---|
| Mass Delete | Modify All Data |
| Mass Transfer Records | Modify All Data (or Transfer Record permission for specific objects) |
| Mass Transfer Approval Requests | Manage Users or Modify All Data |
| Mass Reassign Account Teams | Modify All Data |
| Mass Reassign Opportunity Teams | Modify All Data |
| Mass Update Addresses | Modify All Data |
| Data Import Wizard | Appropriate object-level CRUD permissions. Does not require Modify All Data. |
| Data Loader | API Enabled permission plus appropriate object-level CRUD permissions |
Key distinction: The Data Import Wizard and Data Loader do not require the “Modify All Data” system permission. They work with the user’s existing object-level permissions. This means you can give a marketing manager the ability to import leads via the Data Import Wizard without giving them admin-level access to the entire org.
Practical Scenario: Full Employee Offboarding Data Transfer
Let’s tie everything together with a realistic scenario. A sales rep named Alex Torres has resigned. Here is the complete data transfer checklist:
Step 1: Audit Alex’s Data
Use Data Loader Export to understand the scope:
SELECT Id, Name FROM Account WHERE OwnerId = '005XXXXXXXXXXXX'
SELECT Id, Name, StageName FROM Opportunity WHERE OwnerId = '005XXXXXXXXXXXX' AND IsClosed = false
SELECT Id, Subject FROM Case WHERE OwnerId = '005XXXXXXXXXXXX' AND IsClosed = false
SELECT Id, Name FROM Lead WHERE OwnerId = '005XXXXXXXXXXXX' AND IsConverted = false
Step 2: Transfer Accounts and Related Records
Use Mass Transfer Records to transfer Alex’s accounts to the new owner. Check the options to also transfer open opportunities and open cases.
Step 3: Transfer Remaining Leads
Use Mass Transfer Records > Transfer Leads to move Alex’s unconverted leads to the new owner.
Step 4: Reassign Account Team Memberships
Use Mass Reassign Account Teams to replace Alex on any account teams where they are listed as a member.
Step 5: Reassign Opportunity Team Memberships
Use Mass Reassign Opportunity Teams to replace Alex on any opportunity teams.
Step 6: Transfer Pending Approvals
Use Mass Transfer Approval Requests to move any approval requests currently assigned to Alex to another approver.
Step 7: Verify
Spot-check several accounts, opportunities, and cases to confirm ownership transferred correctly. Run a report filtered by OwnerId to confirm no records still belong to Alex.
Step 8: Freeze and Deactivate
Freeze Alex’s user account (to prevent login) and then deactivate it. You cannot deactivate a user who still owns records, which is why Steps 2-6 must happen first.
Summary Table
| Tool | Location | Objects | Operations | Max Records | CSV Required | Automatable |
|---|---|---|---|---|---|---|
| Mass Delete | Setup > Data | 8 standard objects | Delete | Unlimited (page-by-page) | No | No |
| Mass Transfer Records | Setup > Data | Accounts, Leads, Service Contracts, Custom Objects | Transfer ownership | Unlimited (page-by-page) | No | No |
| Mass Transfer Approval Requests | Setup > Data | All objects with approval processes | Transfer pending approvals | Unlimited (page-by-page) | No | No |
| Mass Reassign Account Teams | Setup > Data | Accounts | Add/Replace/Remove team members | Unlimited (page-by-page) | No | No |
| Mass Reassign Opportunity Teams | Setup > Data | Opportunities | Add/Replace/Remove team members | Unlimited (page-by-page) | No | No |
| Mass Update Addresses | Setup > Data | Accounts | Update billing/shipping addresses | Unlimited (page-by-page) | No | No |
| Data Import Wizard | Setup > Data | Leads, Accounts/Contacts, Solutions, Campaign Members, Custom Objects | Insert, Update, Upsert | 50,000 | Yes | No |
| Data Loader (GUI) | Desktop app | All objects | Insert, Update, Upsert, Delete, Hard Delete, Export | 5,000,000 | Yes | No |
| Data Loader (CLI) | Desktop app (CLI mode) | All objects | Insert, Update, Upsert, Delete, Hard Delete, Export | 5,000,000 | Yes | Yes |
What’s Next?
In Part 34, we will explore Salesforce Offline Access — how the Salesforce mobile app handles offline scenarios, which data is cached, how conflicts are resolved when the device reconnects, and how administrators configure offline access for their users. Offline access is a critical capability for field reps and service technicians who work in areas with unreliable connectivity.
See you in the next post!