{"id":2539,"date":"2026-11-06T13:00:00","date_gmt":"2026-11-06T07:30:00","guid":{"rendered":"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/"},"modified":"2026-11-15T22:00:51","modified_gmt":"2026-11-15T16:30:51","slug":"salesforce-data-seeding","status":"publish","type":"post","link":"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/","title":{"rendered":"Salesforce Data Seeding for Scratch Orgs Explained"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Salesforce Data Seeding is how every fresh org ends up with the same starting records. A scratch org is created empty, so without a seed step each developer invents their own courses and contacts, and a bug that depends on data becomes impossible to reproduce.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The goal is not a copy of production. It is a small, deliberate set that exercises the awkward cases, lives in Git, and loads in seconds.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/salesforce-data-seeding-diagram-1-1-1024x640.png\" alt=\"Salesforce Data Seeding diagram showing export, repository, create and import steps\" class=\"wp-image-2537\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/salesforce-data-seeding-diagram-1-1-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/salesforce-data-seeding-diagram-1-1-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/salesforce-data-seeding-diagram-1-1-768x480.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Caption: The import runs after the deployment, because the objects have to exist first.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Salesforce Data Seeding Looks Like<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Salesforce Data Seeding runs from the CLI, which reads a plan file, which lists record files in the order they must load.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[\n  {\n    \"sobject\": \"Account\",\n    \"saveRefs\": true,\n    \"resolveRefs\": false,\n    \"files\": [\"Accounts.json\"]\n  },\n  {\n    \"sobject\": \"Contact\",\n    \"saveRefs\": true,\n    \"resolveRefs\": true,\n    \"files\": [\"Contacts.json\"]\n  },\n  {\n    \"sobject\": \"Course__c\",\n    \"saveRefs\": true,\n    \"resolveRefs\": true,\n    \"files\": [\"Courses.json\"]\n  }\n]<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Plan key<\/th><th>What it does<\/th><\/tr><\/thead><tbody><tr><td>sobject<\/td><td>The object this group loads<\/td><\/tr><tr><td>files<\/td><td>The record files for that object<\/td><\/tr><tr><td>saveRefs<\/td><td>Remembers the new ids so children can point at them<\/td><\/tr><tr><td>resolveRefs<\/td><td>Replaces reference names with the real ids<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Those two flags are the whole mechanism of Salesforce Data Seeding. A parent saves its references and a child resolves them, which is how a relationship survives a load into an org where no ids exist yet.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The Record Files<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"records\": [\n    {\n      \"attributes\": { \"type\": \"Contact\", \"referenceId\": \"ContactRef1\" },\n      \"LastName\": \"Mehta\",\n      \"FirstName\": \"Asha\",\n      \"AccountId\": \"@AccountRef1\"\n    }\n  ]\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>referenceId<\/code> is a name you invent, and the at sign prefix points at one. Nothing here depends on a real Salesforce id, which is what makes the files portable between orgs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating the Files<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sf data export tree \\\n  --query \"SELECT Id, Name, Fee__c, Level__c FROM Course__c LIMIT 10\" \\\n  --plan \\\n  --output-dir data\n\nsf data import tree --plan data\/sample-plan.json --target-org dev1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Salesforce Data Seeding starts with one export from an org where the data is right, then commit the files. Editing them by hand afterwards is normal, and it is often where the awkward test cases get added.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Salesforce Data Seeding Matters<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Benefit<\/th><th>What it gives the team<\/th><\/tr><\/thead><tbody><tr><td>The same data everywhere<\/td><td>A bug one person sees, everybody sees<\/td><\/tr><tr><td>A fast new org<\/td><td>Minutes rather than an afternoon<\/td><\/tr><tr><td>Reviewable test cases<\/td><td>Edge cases visible in a pull request<\/td><\/tr><tr><td>Honest demos<\/td><td>The same records in every demo org<\/td><\/tr><tr><td>No production data in development<\/td><td>A real privacy benefit<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">That last row deserves attention. Copying production records into a developer org spreads personal data into environments with looser access, and a small invented data set avoids the problem entirely. The post on <a href=\"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/\">scratch org definition files<\/a> covers the org itself.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Designing the Seed Set<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Good Salesforce Data Seeding is small and opinionated. Ask what each record is for, and remove anything with no answer.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Record<\/th><th>Why it is there<\/th><\/tr><\/thead><tbody><tr><td>A course with no fee<\/td><td>Proves the null handling works<\/td><\/tr><tr><td>A course at the maximum fee<\/td><td>Proves the validation rule fires<\/td><\/tr><tr><td>An online course<\/td><td>Proves the discount applies<\/td><\/tr><tr><td>A contact with no account<\/td><td>Proves the orphan path works<\/td><\/tr><tr><td>A course with a very long name<\/td><td>Proves the layout does not break<\/td><\/tr><tr><td>Two courses with the same name<\/td><td>Proves the duplicate rule triggers<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Six Salesforce Data Seeding records like that are worth more than six hundred random ones, because every one of them is a test waiting to happen.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Seed set size<\/th><th>What it suits<\/th><\/tr><\/thead><tbody><tr><td>Under 50 records<\/td><td>Daily development, the usual answer<\/td><\/tr><tr><td>A few hundred<\/td><td>Demos and layout checks<\/td><\/tr><tr><td>Thousands<\/td><td>A performance test, built by a script<\/td><\/tr><tr><td>Production volume<\/td><td>A full sandbox, not a seed set<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Tree Import or an Apex Factory<\/h2>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/salesforce-data-seeding-diagram-2-1-1024x640.png\" alt=\"Salesforce Data Seeding comparison diagram of tree import and an Apex factory\" class=\"wp-image-2538\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/salesforce-data-seeding-diagram-2-1-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/salesforce-data-seeding-diagram-2-1-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/salesforce-data-seeding-diagram-2-1-768x480.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Caption: They solve different problems, so most projects use both.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Salesforce Data Seeding is for people, not for tests. Unit tests should build their own data, because a test that depends on records already in the org is not a unit test.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@IsTest\npublic class TestFactory {\n\n    public static Course__c course(String level, Decimal fee) {\n        return new Course__c(\n            Name = 'Test ' + level,\n            Level__c = level,\n            Fee__c = fee,\n            Duration_in_Weeks__c = 6\n        );\n    }\n\n    public static List&lt;Course__c&gt; courses(Integer count) {\n        List&lt;Course__c&gt; rows = new List&lt;Course__c&gt;();\n        for (Integer i = 0; i &lt; count; i++) {\n            rows.add(course('Beginner', 3000 + i));\n        }\n        return rows;\n    }\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Need<\/th><th>Pick<\/th><\/tr><\/thead><tbody><tr><td>Records a developer clicks on<\/td><td>Tree import<\/td><\/tr><tr><td>Data for a unit test<\/td><td>Apex factory<\/td><\/tr><tr><td>A demo org that looks real<\/td><td>Tree import<\/td><\/tr><tr><td>Two hundred records for a bulk test<\/td><td>Apex factory<\/td><\/tr><tr><td>Something a reviewer should see in Git<\/td><td>Tree import<\/td><\/tr><tr><td>Records that must not persist<\/td><td>Apex factory<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The post on <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-stub-api-mocking\/\">the Apex Stub API<\/a> covers the third option, which is needing no data at all.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A Real Salesforce Data Seeding Example<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Salesforce Data Seeding fixed a recurring argument for us. Bright Path Tutors had no seed step. Each developer created a handful of courses by hand, named after whatever was on their desk.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Problem<\/th><th>What it cost<\/th><\/tr><\/thead><tbody><tr><td>Different data per developer<\/td><td>Bugs nobody else could reproduce<\/td><\/tr><tr><td>No zero fee course anywhere<\/td><td>A null handling bug reached production<\/td><\/tr><tr><td>Demo orgs built by hand<\/td><td>An hour before every demo<\/td><\/tr><tr><td>A production extract used once<\/td><td>Personal data in three developer orgs<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We built a 31 record seed set with a plan file.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Measure<\/th><th>Before<\/th><th>After<\/th><\/tr><\/thead><tbody><tr><td>Records in a new org<\/td><td>Whatever you typed<\/td><td>31, always the same<\/td><\/tr><tr><td>Time to a usable org<\/td><td>45 minutes<\/td><td>Under 2 minutes<\/td><\/tr><tr><td>Bugs that could not be reproduced<\/td><td>Several a month<\/td><td>Rare<\/td><\/tr><tr><td>Production records in developer orgs<\/td><td>Yes<\/td><td>None<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The zero fee course is the Salesforce Data Seeding detail worth repeating. Nobody had one, so nobody found the bug, and it took a customer to report it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Loading Larger Volumes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When Salesforce Data Seeding grows past a few hundred records, change tool rather than stretching this one.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Volume<\/th><th>Tool<\/th><\/tr><\/thead><tbody><tr><td>Under a few hundred<\/td><td>Tree import with a plan<\/td><\/tr><tr><td>Thousands<\/td><td>A CSV with the bulk upsert command<\/td><\/tr><tr><td>Millions<\/td><td>Bulk API 2.0<\/td><\/tr><tr><td>Generated data for a load test<\/td><td>An Apex script run from the CLI<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>sf data upsert bulk \\\n  --sobject Course__c \\\n  --file data\/courses.csv \\\n  --external-id External_Id__c \\\n  --wait 10<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The post on <a href=\"https:\/\/swapnilzambare.com\/blog\/salesforce-bulk-api-2\/\">Bulk API 2.0<\/a> covers the largest end of that table.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Limits and Things to Watch<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Tree import suits a small number of records, not a bulk load<\/li>\n\n<li>Load order is yours to get right, since a child cannot point at a missing parent<\/li>\n\n<li>Required fields and validation rules apply, so a seed file can be rejected<\/li>\n\n<li>Record types and picklist values must exist in the org already<\/li>\n\n<li>Triggers and Flows fire during the import, which can create extra records<\/li>\n\n<li>Owner and created date cannot be set freely, so a seed set always looks new<\/li>\n\n<li>Person accounts and some standard objects need extra care<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The trigger point produces the most surprises in Salesforce Data Seeding. An import can fire automation that sends an email or creates a task, so a brand new org ends up with records nobody put in the plan. Check the result once, then adjust the plan rather than the automation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common Mistakes with Salesforce Data Seeding<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Mistake<\/th><th>What you see<\/th><th>Fix<\/th><\/tr><\/thead><tbody><tr><td>Children before parents in the plan<\/td><td>Reference errors on import<\/td><td>Order the plan parents first<\/td><\/tr><tr><td>saveRefs missing on a parent<\/td><td>Children with empty lookups<\/td><td>Set saveRefs on the parent group<\/td><\/tr><tr><td>A production extract used as the seed<\/td><td>Personal data in developer orgs<\/td><td>Invent the records instead<\/td><\/tr><tr><td>Hundreds of random records<\/td><td>Slow imports and no test value<\/td><td>Keep it small and deliberate<\/td><\/tr><tr><td>No edge cases in the set<\/td><td>Bugs found by customers<\/td><td>Add a record per awkward case<\/td><\/tr><tr><td>Hard coded ids in the files<\/td><td>An import that works in one org only<\/td><td>Use reference names<\/td><\/tr><tr><td>Unit tests reading seed data<\/td><td>Tests that pass only in a seeded org<\/td><td>Build data in an Apex factory<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Best Practices for Salesforce Data Seeding<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Keep the seed set under 50 records unless there is a reason<\/li>\n\n<li>Give every record a purpose, and delete the ones with none<\/li>\n\n<li>Include a record for each awkward case, such as a null value or a maximum<\/li>\n\n<li>Use reference names rather than ids so the files are portable<\/li>\n\n<li>Commit the files and review changes to them like code<\/li>\n\n<li>Run the import as part of the same script that creates and deploys the org<\/li>\n\n<li>Never seed with production records, for privacy as much as for size<\/li>\n\n<li>Build unit test data in Apex and keep the seed set for people<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Most Asked Salesforce Data Seeding Interview Questions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q1: Why does a scratch org need seeding?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because it is created empty, so without a seed step every developer invents their own data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q2: What does a plan file do?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It lists the record files per object, in the order they must load.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q3: What does saveRefs do?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It remembers the new record ids so later groups can point at them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q4: What does resolveRefs do?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It replaces reference names in child records with the real ids.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q5: What is a referenceId?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A name you invent for a record, used in place of a real id.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q6: How does a child point at a parent?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With the reference name prefixed by an at sign in the lookup field.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q7: Why does that matter?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because ids differ per org, so reference names keep the files portable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q8: How do you create the files in the first place?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Export from an org where the data is right, using the tree export command with the plan flag.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q9: When does the import run?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After the deployment, since the objects must exist first.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q10: How big should a seed set be?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Usually under 50 records, each with a clear purpose.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q11: Why not copy production data?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It spreads personal data into looser environments, and it is far larger than needed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q12: What belongs in a seed set that people forget?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Edge cases, such as a null value, a maximum value and a duplicate.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q13: Does automation fire during an import?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Triggers and Flows run, which can create records the plan never mentioned.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q14: What happens if the plan lists children first?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The references cannot resolve, so the import fails.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q15: Do validation rules apply?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, so a seed file can be rejected by a rule like any other insert.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q16: Can you set the created date or the owner?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Not freely, so a seed set always looks newly created.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q17: When do you move away from tree import?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Past a few hundred records, where a bulk upsert from CSV is the better tool.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q18: What loads millions of rows?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bulk API 2.0.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q19: Should unit tests use the seed data?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">No. A test that depends on org records is not a unit test.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q20: What should tests use instead?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An Apex test factory that builds its own records, or stubs that need none.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q21: Why keep a factory separate from the seed set?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">They solve different problems, one for people using an org and one for tests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q22: Where should the seed files live?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the repository, reviewed like code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q23: Why review changes to seed data?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because adding or removing a record changes what the whole team tests against.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q24: Scenario: a bug appears only on one developer&#8217;s machine. What is the likely cause?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Different data in their org, which a shared seed set removes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q25: Scenario: a new org has tasks nobody created. Why?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Automation fired during the import.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q26: Scenario: contacts load with empty account lookups. What is wrong?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The parent group is missing saveRefs, or the children are missing resolveRefs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q27: Scenario: a null handling bug reached production. What was missing from the seed set?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A record with that field left empty.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q28: Scenario: the import takes four minutes. What now?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The set is too large for tree import, so move the bulk of it to a CSV upsert.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q29: Can one plan file seed several objects?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, which is the normal case, with one group per object in load order.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q30: How do you keep demos consistent?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Seed every demo org from the same files, so each demo shows the same records.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q31: What is the one habit that makes seeding worthwhile?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Give every record a reason to exist, and keep the whole set small enough to read.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Official Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.sfdx_dev.meta\/sfdx_dev\/\" target=\"_blank\" rel=\"noopener noreferrer\">Salesforce DX Developer Guide<\/a><\/li>\n\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.sfdx_cli_reference.meta\/sfdx_cli_reference\/\" target=\"_blank\" rel=\"noopener noreferrer\">Salesforce CLI Command Reference<\/a><\/li>\n\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.apexcode.meta\/apexcode\/\" target=\"_blank\" rel=\"noopener noreferrer\">Apex Developer Guide<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What Is Next<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Next, read <a href=\"https:\/\/swapnilzambare.com\/blog\/lwr-sites-experience-cloud\/\">LWR Sites in Experience Cloud Explained for Developers<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Salesforce Data Seeding gives every new org the same starting records. Learn tree files, plan files, Apex factories and how to keep a seed set honest.<\/p>\n","protected":false},"author":1,"featured_media":2536,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_swapz_level":"","_swapz_series_part":0,"_swapz_hide_toc":false,"_swapz_hide_featured":false,"_swapz_description":"","footnotes":""},"categories":[247,8,96],"tags":[27,130,26],"swapz_series":[],"class_list":["post-2539","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops-packaging","category-salesforce","category-salesforce-developer","tag-data-management","tag-devops","tag-intermediate"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Salesforce Data Seeding for Scratch Orgs<\/title>\n<meta name=\"description\" content=\"Salesforce Data Seeding gives every new org the same starting records. Learn tree files, plan files, Apex factories and how to keep a seed set honest.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Salesforce Data Seeding for Scratch Orgs\" \/>\n<meta property=\"og:description\" content=\"Salesforce Data Seeding gives every new org the same starting records. Learn tree files, plan files, Apex factories and how to keep a seed set honest.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/\" \/>\n<meta property=\"og:site_name\" content=\"Swapnil Zambare - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-06T07:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-15T16:30:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/salesforce-data-seeding-featured-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Swapnil Zambare\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Swapnil Zambare\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/salesforce-data-seeding\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/salesforce-data-seeding\\\/\"},\"author\":{\"name\":\"Swapnil Zambare\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/10b09224c8bcc562716e86789427592a\"},\"headline\":\"Salesforce Data Seeding for Scratch Orgs Explained\",\"datePublished\":\"2026-11-06T07:30:00+00:00\",\"dateModified\":\"2026-11-15T16:30:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/salesforce-data-seeding\\\/\"},\"wordCount\":1898,\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/salesforce-data-seeding\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/salesforce-data-seeding-featured-1.png\",\"keywords\":[\"Data Management\",\"DevOps\",\"Intermediate\"],\"articleSection\":[\"DevOps and Packaging\",\"Salesforce\",\"Salesforce Developer\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/salesforce-data-seeding\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/salesforce-data-seeding\\\/\",\"name\":\"Salesforce Data Seeding for Scratch Orgs\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/salesforce-data-seeding\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/salesforce-data-seeding\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/salesforce-data-seeding-featured-1.png\",\"datePublished\":\"2026-11-06T07:30:00+00:00\",\"dateModified\":\"2026-11-15T16:30:51+00:00\",\"description\":\"Salesforce Data Seeding gives every new org the same starting records. Learn tree files, plan files, Apex factories and how to keep a seed set honest.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/salesforce-data-seeding\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/salesforce-data-seeding\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/salesforce-data-seeding\\\/#primaryimage\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/salesforce-data-seeding-featured-1.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/salesforce-data-seeding-featured-1.png\",\"width\":2400,\"height\":1260,\"caption\":\"Salesforce Data Seeding featured image showing records loading into a fresh org\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/salesforce-data-seeding\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Salesforce Data Seeding for Scratch Orgs Explained\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\",\"name\":\"Swapnil Zambare - Blog\",\"description\":\"Salesforce &amp; Tech Guides\",\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\",\"name\":\"Swapnil Zambare - Blog\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/site-icon-512.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/site-icon-512.png\",\"width\":512,\"height\":512,\"caption\":\"Swapnil Zambare - Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/theSwapnilZambare\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/10b09224c8bcc562716e86789427592a\",\"name\":\"Swapnil Zambare\",\"sameAs\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\"],\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/author\\\/swapnil-zambare\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Salesforce Data Seeding for Scratch Orgs","description":"Salesforce Data Seeding gives every new org the same starting records. Learn tree files, plan files, Apex factories and how to keep a seed set honest.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/","og_locale":"en_US","og_type":"article","og_title":"Salesforce Data Seeding for Scratch Orgs","og_description":"Salesforce Data Seeding gives every new org the same starting records. Learn tree files, plan files, Apex factories and how to keep a seed set honest.","og_url":"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/","og_site_name":"Swapnil Zambare - Blog","article_published_time":"2026-11-06T07:30:00+00:00","article_modified_time":"2026-11-15T16:30:51+00:00","og_image":[{"width":2400,"height":1260,"url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/salesforce-data-seeding-featured-1.png","type":"image\/png"}],"author":"Swapnil Zambare","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Swapnil Zambare","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/#article","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/"},"author":{"name":"Swapnil Zambare","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/10b09224c8bcc562716e86789427592a"},"headline":"Salesforce Data Seeding for Scratch Orgs Explained","datePublished":"2026-11-06T07:30:00+00:00","dateModified":"2026-11-15T16:30:51+00:00","mainEntityOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/"},"wordCount":1898,"publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/salesforce-data-seeding-featured-1.png","keywords":["Data Management","DevOps","Intermediate"],"articleSection":["DevOps and Packaging","Salesforce","Salesforce Developer"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/","url":"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/","name":"Salesforce Data Seeding for Scratch Orgs","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/#primaryimage"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/salesforce-data-seeding-featured-1.png","datePublished":"2026-11-06T07:30:00+00:00","dateModified":"2026-11-15T16:30:51+00:00","description":"Salesforce Data Seeding gives every new org the same starting records. Learn tree files, plan files, Apex factories and how to keep a seed set honest.","breadcrumb":{"@id":"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/#primaryimage","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/salesforce-data-seeding-featured-1.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/salesforce-data-seeding-featured-1.png","width":2400,"height":1260,"caption":"Salesforce Data Seeding featured image showing records loading into a fresh org"},{"@type":"BreadcrumbList","@id":"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/swapnilzambare.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Salesforce Data Seeding for Scratch Orgs Explained"}]},{"@type":"WebSite","@id":"https:\/\/swapnilzambare.com\/blog\/#website","url":"https:\/\/swapnilzambare.com\/blog\/","name":"Swapnil Zambare - Blog","description":"Salesforce &amp; Tech Guides","publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/swapnilzambare.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/swapnilzambare.com\/blog\/#organization","name":"Swapnil Zambare - Blog","url":"https:\/\/swapnilzambare.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/09\/site-icon-512.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/09\/site-icon-512.png","width":512,"height":512,"caption":"Swapnil Zambare - Blog"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/in\/theSwapnilZambare"]},{"@type":"Person","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/10b09224c8bcc562716e86789427592a","name":"Swapnil Zambare","sameAs":["https:\/\/swapnilzambare.com\/blog"],"url":"https:\/\/swapnilzambare.com\/blog\/author\/swapnil-zambare\/"}]}},"_links":{"self":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/2539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/comments?post=2539"}],"version-history":[{"count":2,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/2539\/revisions"}],"predecessor-version":[{"id":3411,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/2539\/revisions\/3411"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media\/2536"}],"wp:attachment":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media?parent=2539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/categories?post=2539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/tags?post=2539"},{"taxonomy":"swapz_series","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/swapz_series?post=2539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}