- Home
- /
- Salesforce Testing
- /
- Test Data Management
- /
- Data Subsetting
Salesforce Data Subsetting
Salesforce data subsetting takes a small, representative slice of a source org — a handful of accounts and everything related — instead of a full copy, so lower environments get realistic data that fits within sandbox limits. SyntraFlow is designed to walk the object graph so a subset stays referentially complete.
This page focuses narrowly on subsetting. For the wider practice of preparing and provisioning test data, see the Salesforce test data management pillar.
The whole org is too much data for most tests
A production org can hold hundreds of millions of rows. A Full sandbox can carry all of it, but refreshing, seeding and querying at that scale is slow, and Partial Copy and Developer sandboxes have far smaller storage allowances. Most tests do not need the whole org — they need a carefully chosen handful of accounts and the records connected to them. Subsetting is the practice of extracting exactly that slice.
The value of a subset lives entirely in its completeness. Pulling fifty accounts is easy; pulling fifty accounts with their Contacts, Opportunities, Contact Roles, Cases, Quotes, custom-object rows and every required lookup — and nothing dangling — is the hard part. A subset that drops a required parent produces records that look fine but fail on insert or behave nothing like production, which defeats the purpose.
The other reason to subset is speed. Every operation a team runs against a sandbox — a refresh, a SOQL query, a data load, a search index rebuild — scales with the number of rows in the org. A Full sandbox that mirrors production makes each of those operations slow, which quietly taxes every hour of testing. A well-chosen subset holds only what the planned scenarios need, so environments load faster, queries return quickly and refresh cycles shrink. The discipline is choosing the seed set well: enough accounts, across enough segments and record types, to represent production behaviour, but no more than the tests actually exercise.
Subsetting selects from real data, so a subset usually pairs with data masking to stay safe in a lower environment. When you want records that never came from production at all, generate synthetic test data instead. Subsetting moves records, not configuration; the objects and fields that define the schema are metadata, a separate discipline.
How SyntraFlow is designed to subset Salesforce data
These capabilities are available for demonstration and proof-of-concept validation. The aim is a slice that is small, representative and referentially complete.
Seed-based selection
Designed to start from a defined set of anchor records — specific accounts, a region, a segment — and grow the subset outward from there so the slice matches a real testing need.
Relationship traversal
Designed to walk parents, children and lookups from each seed so related Contacts, Opportunities, Cases and custom rows come along and no required record is orphaned.
Required-lookup completion
Designed to pull in every record a selected row depends on, so inserts succeed in dependency order and the subset does not fail on a missing parent.
Representative sampling
Designed to spread the seed set across segments, record types and states so the subset reflects production variety rather than one narrow slice of it.
Size-target control
Designed to scale the subset toward a target volume so it fits comfortably inside a Partial Copy or Developer sandbox storage allowance.
Mask-on-extract
Designed to apply masking as records leave the source, so sensitive values are transformed before the subset ever lands in a lower environment.
Dependency-ordered load
Designed to insert the subset parents-before-children so foreign keys resolve and the provisioned data is valid from the first record.
Custom-object awareness
Designed to include each org's own custom objects and master-detail chains, because a subset that ignores custom relationships breaks the automation built on them.
Repeatable subset definitions
Designed to save a subset's rules so the same representative slice can be re-extracted after a refresh without rebuilding the selection by hand.
Sandbox types and why subsetting helps
Salesforce sandbox types differ sharply in how much data they can hold. A right-sized subset is what makes the smaller, faster ones usable.
| Sandbox type | Data it copies | Where subsetting fits |
|---|---|---|
| Developer | Metadata only, small storage | Load a tiny, complete subset so the org is usable, not empty. |
| Developer Pro | Metadata only, larger storage | Provision a richer representative subset for feature testing. |
| Partial Copy | Metadata plus a sample of data | Shape the sample into a coherent, referentially complete slice. |
| Full | Metadata plus all data | Subset to speed queries and to carve focused datasets for suites. |
Sandbox storage limits and refresh intervals are set by Salesforce and vary by edition and licensing; confirm the current figures for your org.
Aligned subsets across every system
When an end-to-end test spans Salesforce and an ERP, the subset on each side has to cover the same customers and orders or the join fails. SyntraFlow is designed to coordinate matching subsets across Salesforce and connected systems such as Oracle ERP, SAP, Workday and NetSuite, so the same entities appear consistently on every side. Explore the counterpart discipline in the Oracle ERP testing tool.
What subsetting is designed to achieve
Fits smaller sandboxes
A right-sized slice makes Developer and Partial Copy orgs usable instead of empty or over capacity.
Realistic but complete
Relationship traversal keeps the slice referentially intact, so it behaves like production rather than a broken fragment.
Faster environments
Less data means quicker loads, queries and refreshes, so teams spend less time waiting on the org.
Less sensitive data moved
Extracting only what a scenario needs, and masking on the way out, limits how much sensitive data ever leaves the source.
Representative coverage
Sampling across segments and record types keeps production variety in a fraction of the volume.
Repeatable after refresh
Saved subset definitions let the same slice be re-extracted whenever a sandbox is refreshed.
Data subsetting FAQs
What is Salesforce data subsetting?
It is extracting a small, representative slice of a source org — a chosen set of accounts and every record related to them — instead of copying the whole org, so lower environments get realistic, referentially complete data that fits within sandbox storage limits.
How does a subset keep related records intact?
Subsetting is designed to walk the object graph from each seed record, pulling in parents, children and required lookups so a selected Account also brings its Contacts, Opportunities, Cases and custom-object rows. Nothing required is orphaned, so inserts succeed in dependency order.
Why not just use a Full sandbox?
A Full sandbox holds all production data, which is slow to refresh and query and spreads more sensitive data than most tests need. A subset gives a faster, smaller, right-sized environment and lets teams carve focused datasets even when a Full sandbox is available.
Does subsetting expose sensitive data?
It does not have to. Subsetting can apply masking on extract, so sensitive values are transformed as records leave the source and the slice that lands in a lower environment already has personal and financial fields replaced with safe substitutes.
How is subsetting different from synthetic data?
A subset selects real records from a source org and keeps production's exact shape; synthetic data is generated from scratch and never touches production. Subset when you need real-world messiness in less volume, synthesise when you need zero exposure or scenarios that do not exist yet.
Can a subset be re-created after a sandbox refresh?
Yes. Subset rules are designed to be saved and reused, so after a refresh clears a sandbox the same representative slice can be re-extracted and provisioned without rebuilding the selection by hand.
Right-size your test data
See how SyntraFlow is designed to extract representative, referentially complete Salesforce subsets that fit any sandbox.