Sandbox Templates
Sandbox Templates define which object data is copied from production when creating or refreshing a Partial Copy Sandbox.
Definition
Sandbox Templates define which object data is copied from production when creating or refreshing a Partial Copy Sandbox. Administrators select up to 10,000 records per object and choose specific objects to include, allowing teams to create focused test datasets that are smaller than a full copy but still representative of real data patterns.
In plain English
“Sandbox Templates define which object data gets copied from production when creating a Partial Copy Sandbox. Admins select up to 10,000 records per object and choose specific objects to include, so the sandbox gets meaningful test data without copying everything.”
Worked example
Glenfield Software's QA team needs a Partial Copy Sandbox seeded with realistic-but-bounded production data for their test cases. Their admin creates a Sandbox Template specifying which objects to include (Account, Contact, Opportunity, Case, Custom_Order__c) and how many records per object (5,000 per object, capped). When the Partial Copy Sandbox is provisioned (or refreshed), the platform copies metadata fully and selectively copies the data per the template - the QA team gets representative test data without the storage cost of a Full Sandbox. Sandbox Templates make Partial Copy Sandboxes useful for focused testing scenarios.
Why Sandbox Templates matters
Sandbox Templates define which object data is copied from production when creating or refreshing a Partial Copy Sandbox. Administrators select up to 10,000 records per object and choose specific objects to include, so the sandbox gets meaningful test data without copying the full production dataset. Templates are applied during sandbox creation or refresh.
Designing good sandbox templates is important for getting useful test environments. Templates that capture representative data produce sandboxes where testing is meaningful; templates that miss important objects or relationships produce sandboxes where testing doesn't match production behavior. Mature DevOps practices invest in template design, ensuring templates capture the data relationships needed for realistic testing.
How to set up Sandbox Templates
Sandbox Templates define which objects' data gets copied from production when refreshing a Partial Copy Sandbox — "copy Account, Contact, Opportunity but skip Cases." Lets teams build focused test datasets smaller than a Full Copy Sandbox but still representative. Only applies to Partial Copy and Full Copy Sandboxes; Developer / Developer Pro Sandboxes have no data anyway.
- Open Setup → Sandboxes (in Production)
Sandbox Templates are managed from Production, not from inside a sandbox.
- Scroll to Sandbox Templates → New
Setup → Sandboxes → Templates tab → New.
- Set Template Name and Description
Convention: per-purpose ("Sales Test - Recent Opps").
- Pick objects to include
Multi-select object list. For each picked object, you can set criteria limiting which records copy (max 10,000 records per object).
- Set Per-Object Criteria (optional)
Filter expressions narrow what copies. "Only Opportunities created in the last 90 days," "Only Accounts in the West region."
- Save
Template is ready. Use it next time you create / refresh a Partial Copy Sandbox.
- When refreshing a Partial Copy Sandbox: pick this template
Setup → Sandboxes → Edit on a Partial Copy → Pick Template → save.
Multi-pick from objects with data.
Filter to limit which records copy.
10,000 hard cap. Larger needs Full Copy Sandbox.
- 10,000 records per object is the hard cap for Partial Copy. If you need more representative data, use Full Copy Sandbox (longer refresh, higher storage).
- Templates apply at refresh time, not creation time of the sandbox. Existing sandboxes don't auto-update when templates change — refresh to pick up new criteria.
- Criteria expressions don't validate at template save. A bad SOQL filter blocks the refresh — test with a sandbox you don't mind losing first.
How organizations use Sandbox Templates
Designed sandbox templates to capture representative data across their data model for realistic testing.
Maintains templates that include critical object relationships for meaningful test scenarios.
Reviews sandbox templates periodically to ensure they reflect current data model needs.
Trust & references
Straight from the source - Salesforce's reference material on Sandbox Templates.
- Sandbox Types and TemplatesSalesforce Help
🧠 Test your knowledge
Q1. What are Sandbox Templates?
Q2. How many records per object?
Q3. Why design templates carefully?

Discussion
Loading discussion…