{"id":115,"date":"2020-05-13T14:07:43","date_gmt":"2020-05-13T12:07:43","guid":{"rendered":"https:\/\/transferttexei.wordpress.com\/2021\/08\/10\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/"},"modified":"2023-08-15T17:11:52","modified_gmt":"2023-08-15T15:11:52","slug":"easily-load-data-into-your-scratch-org-or-sandbox-part-2","status":"publish","type":"post","link":"https:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/","title":{"rendered":"Easily load data into your Scratch Org (or Sandbox): Part 2"},"content":{"rendered":"\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p>This is a two parts blog series: <a href=\"https:\/\/texei.com\/conseils\/easily-load-data-into-your-scratch-org-or-sandbox-part-1\" target=\"_blank\" rel=\"noopener\">Part 1 is focused on a simple command to export\/import data<\/a>, while Part 2 handles with more advanced use cases.<\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><strong>Limitations<\/strong><\/h2>\r\n\r\n\r\n\r\n<p>Having an easy to use command to export\/import data is nice, but at some point you may be stuck with more complex use cases.<\/p>\r\n\r\n\r\n\r\n<p>This happened to me with a quite basic one though. The command described in the first part of this blog post series (see <a href=\"https:\/\/blog.texei.com\/easily-load-data-into-your-scratch-org-or-sandbox-part-1-89b7e385fb0c\" target=\"_blank\" rel=\"noopener\">here<\/a> if you haven\u2019t read it) was intended to be as easy to use as possible. But what if you need to handle a relationship between the same sObject\u00a0? For instance Account and Parent Account. Well, it just doesn\u2019t work.<\/p>\r\n\r\n\r\n\r\n<p>We started to use the command on several projects (including moving data for Salesforce CPQ \/ Billing), and it quickly became obvious that even though the command was easy to use, it had too many limitations :<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>No way to handle relationships on the same sObjects (Account\/Parent Account).<\/li>\r\n<li>No way to exclude fields (for instance a source org had audit fields writeable, whereas the target org did not, so we wanted to remove CreatedDate, LastModifiedDate, etc\u2026).<\/li>\r\n<li>No way to update records previously inserted (if you have circular dependencies, you may need to first create a record and update later once some other related records are created).<\/li>\r\n<li>No way to filter the records you want to export.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>Again, this was something intended at the beginning, as the main point of the command was to be as easy as possible. There are already lots of powerful data loading tools out there that can do whatever you want, and the point wasn\u2019t to replace them.<\/p>\r\n\r\n\r\n\r\n<p>Still, there was room for improvement.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><strong>A more powerful\u00a0command<\/strong><\/h2>\r\n\r\n\r\n\r\n<p>So how should we add these features to the existing command ?<\/p>\r\n<p>Exporting a few sObjects looks like this :<\/p>\r\n\r\n\r\n\r\n<p><code>sfdx texei:data:export \u2014-objects Account,Contact,Opportunity,MyCustomObject__c --outputdir\u00a0.\/data<\/code><\/p>\r\n\r\n\r\n\r\n<p>Obviously, if we wanted to add filters to each exported sObjects, that would quickly become a giant command to run, and a not very scalable one if we need to add more options (like fields we want to exclude).<\/p>\r\n\r\n\r\n\r\n<p>We choose in this case to rely on a data plan file, that would describe what we want to export, with every options for every sObjects. The other good thing with using a file is that it makes it easy to export data again with all the same options.<\/p>\r\n\r\n\r\n\r\n<p>Let\u2019s generate a sample data plan file by running the following command :<\/p>\r\n\r\n\r\n\r\n<p><code>sfdx texei:data:plan:generate --objects Account,Contact,MyCustomObject__c --outputdir\u00a0.\/data<\/code><\/p>\r\n\r\n\r\n\r\n<p>This will generate the following <code>data-plan.json<\/code> file for you (provided that the data folder already exists) :<\/p>\r\n\r\n\r\n<script src=\"https:\/\/gist.github.com\/fffeab6abd4ff86e14930f926cfd852f.js\"><\/script>\n\r\n\r\n\r\n<p>Then you can fill in all options :<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li><code>excludedFields<\/code> : a list of fields to exclude. Either at sObject level, or at root level where it will exclude fields for all sObjects.<\/li>\r\n<li><code>name<\/code> : the developer name of the sObject to export. This is the only mandatory field.<\/li>\r\n<li><code>label<\/code> : a label that will be used for the file, useful if you\u2019re exporting the same sObject several time.<\/li>\r\n<li><code>filters<\/code> : a filter that will get added to a where clause.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>Each sObject will be exported and imported in the order coming from the json file, meaning you\u2019ll need the parent sObjects to be listed first, otherwise hierarchy won\u2019t be exported\/imported correctly.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><strong>Managing relationship between the same\u00a0sObject<\/strong><\/h2>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">With a single level of hierarchy<\/h3>\r\n\r\n\r\n\r\n<p>Let\u2019s take a basic Account\/Parent Account relationship, you could simply run the following :<\/p>\r\n\r\n\r\n\r\n<p><code>sfdx texei:data:plan:generate --objects Account,Account --outputdir\u00a0.\/data<\/code><\/p>\r\n\r\n\r\n\r\n<p>Here, Account is exported twice, because we first want to export the parents, and then the children. This way parents will be inserted first, the command will bring the Ids back from the insert, and the relationship will be replaced on the fly while inserting child accounts. Your data plan would just need to filter the ParentId accordingly :<\/p>\r\n\r\n\r\n<script src=\"https:\/\/gist.github.com\/b42f46cfff612a16cab3c68b6700acd7.js\"><\/script>\n\r\n\r\n\r\n<p>Running the <code>sfdx texei:data:export<\/code> command with this data plan would just :<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Export all accounts without a parent (<code>ParentId = null<\/code> ).<\/li>\r\n<li>Export all accounts with a parent ( <code>ParentId\u00a0!= null<\/code> ).<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>Then running the <code>sfdx texei:data:import<\/code> command would:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Import the parents first (because it\u2019s the first exported sObject).<\/li>\r\n<li>Import the child, making sure that parents are already imported.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>Doing it the other way round would just insert the child sObjects with the ParentId lookup empty, because the relationship couldn\u2019t be resolved (Parent wouldn\u2019t be imported at this time).<\/p>\r\n\r\n\r\n\r\n<p>This works fine when you have only one level of parents, but what if you have 3 or 4 levels\u00a0?<\/p>\r\n<p>All children would be part of the 2nd export, and may not be inserted in the correct order. Let\u2019s look at a better way to do it.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">With multiple levels of hierarchy<\/h3>\r\n\r\n\r\n\r\n<p>To manage multiple levels of hierarchy, you could try to separate all parents and child in multiple files with different filters, but that would quickly become painful.<\/p>\r\n\r\n\r\n\r\n<p>Another option is to export all records first, without the relationship field (so that all records will get created and will have an id), and then update them with the relationship field. The command will take care of inserting or updating, depending on whether the record was already created in a previous step or not.<\/p>\r\n\r\n\r\n\r\n<h4>Looking at this file :<\/h4>\r\n\r\n\r\n<script src=\"https:\/\/gist.github.com\/652500668216196c1a85e1039b8a003b.js\"><\/script>\n\r\n\r\n\r\n<p>Here you\u2019re just exporting\/importing all the accounts twice, so you\u2019ll get the exact same data in both exported files. During import, you won\u2019t get any duplicate, the second import will just update the records inserted previously. In this specific case it doesn\u2019t make sense as data will be the same.<\/p>\r\n\r\n\r\n\r\n<h4>But let\u2019s look at this file :<\/h4>\r\n\r\n\r\n<script src=\"https:\/\/gist.github.com\/c48450589a5c4fe67e2686296d5bbb14.js\"><\/script>\n\r\n\r\n\r\n<h4>Here the command will :<\/h4>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Export\/import all accounts with all fields, excluding the ParentId field.<\/li>\r\n<li>Export\/import all accounts again, with the relationship field (ParentId).<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>This way you\u2019ll get all accounts inserted first, with ParentId empty. And then all same accounts will get updated with the relationship. As all accounts will be inserted in the first batch, you then don\u2019t care about the number of levels in the relationship, all accounts will be there.<\/p>\r\n\r\n\r\n\r\n<p>Is it the most efficient\u00a0? Maybe not. Is it the easiest\u00a0? I think so, as you don\u2019t have to manage as many exports and filtering as the number of levels you have.<\/p>\r\n\r\n\r\n\r\n<p>Again, there are lots of powerful tools to manage millions of records insertion. This tool is focused on easily retrieving and inserting data for your dev environment. Once a data plan is created, it\u2019s very easy to \u201crefresh\u201d the data as you\u2019ll just have to run the export command once again.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><strong>A more complex\u00a0example<\/strong><\/h2>\r\n\r\n\r\n\r\n<p>Let\u2019s say we have the following data model :<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"800\" height=\"440\" class=\"wp-image-2206\" src=\"https:\/\/texei.com\/dev\/wp-content\/uploads\/2020\/05\/1_dgroWhWLXuX9qb29ny0XaQ.png\" alt=\"\" srcset=\"https:\/\/texei.com\/dev\/wp-content\/uploads\/2020\/05\/1_dgroWhWLXuX9qb29ny0XaQ.png 800w, https:\/\/texei.com\/dev\/wp-content\/uploads\/2020\/05\/1_dgroWhWLXuX9qb29ny0XaQ-300x165.png 300w, https:\/\/texei.com\/dev\/wp-content\/uploads\/2020\/05\/1_dgroWhWLXuX9qb29ny0XaQ-768x422.png 768w, https:\/\/texei.com\/dev\/wp-content\/uploads\/2020\/05\/1_dgroWhWLXuX9qb29ny0XaQ-200x110.png 200w, https:\/\/texei.com\/dev\/wp-content\/uploads\/2020\/05\/1_dgroWhWLXuX9qb29ny0XaQ-400x220.png 400w, https:\/\/texei.com\/dev\/wp-content\/uploads\/2020\/05\/1_dgroWhWLXuX9qb29ny0XaQ-600x330.png 600w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\r\n\r\n\r\n\r\n<p>Said with words, you have :<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Account and Parent Account.<\/li>\r\n<li>Contact, with a standard lookup to Account, and a <code>Test__c<\/code> field that we don\u2019t want to retrieve (maybe we\u2019re retrieving data from a sandbox with some tests made on it).<\/li>\r\n<li>A Custom Object having a lookup to Contact.<\/li>\r\n<li>Account, having itself a lookup to the Custom Object.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>To be able to export and import these sObjects, your <code>data-plan.json<\/code> file would look like this :<\/p>\r\n\r\n\r\n<script src=\"https:\/\/gist.github.com\/0fa7ffaf15b79ac5cd58312930f40eb3.js\"><\/script>\n\r\n\r\n\r\n<p>The root <code>excludedFields<\/code> is not mandatory. The command will query the schema to retrieve all createable fields so you shouldn\u2019t bother. But as I said previously I had a use case with a source org that had audit fields writeable and target org didn\u2019t. So this is just the way you can make it work easily.<\/p>\r\n\r\n\r\n\r\n<p>You can then import the exported data with just one command line :<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>sfdx texei:data:import --inputdir .\/data<\/code><\/pre>\r\n\r\n\r\n\r\n<p>And that\u2019s it !<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><strong>One specific word : Standard Pricebook<\/strong><\/h2>\r\n\r\n\r\n\r\n<p>Standard Pricebook is a little bit tricky, because :<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>All Products having a Pricebook Entry linked to any custom Pricebook must also have a Pricebook Entry linked to the Standard Pricebook.<\/li>\r\n<\/ul>\r\n<blockquote>\r\n<p>So you must import Pricebook Entries linked to the Standard Pricebook first.<\/p>\r\n<\/blockquote>\r\n<ul>\r\n<li>Standard Pricebook is part of the org, it can\u2019t be created or replaced by any other Pricebook.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>It\u2019s fine in a sandbox to sandbox scenario where it will likely have the same id in all sandboxes. However in a Scratch Org, the Pricebook Id will be different for every org. The command will handle this use case for you, querying the Standard Pricebook Id for you a replacing it on the fly while importing records.<\/p>\r\n\r\n\r\n\r\n<p>For this use case, the following <code>data-plan.json<\/code> file should do the job :<\/p>\r\n\r\n\r\n<script src=\"https:\/\/gist.github.com\/287c061a75acfe5fa1ee4e42fa1bb4d6.js\"><\/script>\n\r\n\r\n\r\n<p>This data plan will :<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Export\/import the Pricebooks (taking care of the Standard Pricebook).<\/li>\r\n<li>Export\/import all Products.<\/li>\r\n<li>Export\/import Pricebook entries linked to the standard Pricebook first.<\/li>\r\n<li>Finally, export\/import Pricebook entries linked to a custom Pricebook (which wouldn\u2019t work without the standard ones being inserted first, which is why we have 2 separate PricebookEntry sections with specific filters: to import and export them in 2 times).<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>That\u2019s it\u00a0! This command solved all our use cases so far, let us know how it goes for you\u00a0!<\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p>I would like to thank <a href=\"https:\/\/medium.com\/u\/1439e7db5412\" target=\"_blank\" rel=\"noopener\">Christian Szandor Knapp<\/a> for proofreading this article, and <a href=\"https:\/\/medium.com\/u\/d332f39cd5a3\" target=\"_blank\" rel=\"noopener\">Audrey Riffaud<\/a> for fixing my english &#x1f604;<\/p>\r\n<\/blockquote>\r\n","protected":false},"excerpt":{"rendered":"<p>This is a two parts blog series: Part 1 is focused on a simple command to export\/import data, while Part 2 handles with more advanced use cases. Limitations Having an easy to use command to export\/import data is nice, but at some point you may be stuck with more complex use cases. This happened to [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":2203,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[300],"tags":[],"class_list":["post-115","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advices"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.5 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Easily load data into your Scratch Org (or Sandbox): Part 2 - Texe\u00ef<\/title>\n<meta name=\"description\" content=\"This is a two parts blog series : Part 1 is focused on a simple command to export\/import data, while Part 2 handles with more advanced use ...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Easily load data into your Scratch Org (or Sandbox): Part 2\" \/>\n<meta property=\"og:description\" content=\"This is a two parts blog series : Part 1 is focused on a simple command to export\/import data, while Part 2 handles with more advanced use ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Texe\u00ef\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-13T12:07:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-15T15:11:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/texei.com\/dev\/wp-content\/uploads\/2020\/05\/1_QrltGbeVXdeBYBFT9jWhWw.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"450\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Fabien Taillon\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\\\/\"},\"author\":{\"name\":\"Fabien Taillon\",\"@id\":\"https:\\\/\\\/texei.com\\\/#\\\/schema\\\/person\\\/082ce6d13635571cae4161f1d4f5a9a7\"},\"headline\":\"Easily load data into your Scratch Org (or Sandbox): Part 2\",\"datePublished\":\"2020-05-13T12:07:43+00:00\",\"dateModified\":\"2023-08-15T15:11:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\\\/\"},\"wordCount\":1527,\"publisher\":{\"@id\":\"https:\\\/\\\/texei.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/1_QrltGbeVXdeBYBFT9jWhWw.png\",\"articleSection\":[\"Advices\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\\\/\",\"url\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\\\/\",\"name\":\"Easily load data into your Scratch Org (or Sandbox): Part 2 - Texe\u00ef\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/texei.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/1_QrltGbeVXdeBYBFT9jWhWw.png\",\"datePublished\":\"2020-05-13T12:07:43+00:00\",\"dateModified\":\"2023-08-15T15:11:52+00:00\",\"description\":\"This is a two parts blog series : Part 1 is focused on a simple command to export\\\/import data, while Part 2 handles with more advanced use ...\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\\\/#primaryimage\",\"url\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/1_QrltGbeVXdeBYBFT9jWhWw.png\",\"contentUrl\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/1_QrltGbeVXdeBYBFT9jWhWw.png\",\"width\":800,\"height\":450,\"caption\":\"Easily load data into your Scratch Org - Part 2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/texei.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Advices\",\"item\":\"https:\\\/\\\/texei.com\\\/en\\\/category\\\/advices\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Easily load data into your Scratch Org (or Sandbox): Part 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/texei.com\\\/#website\",\"url\":\"https:\\\/\\\/texei.com\\\/\",\"name\":\"Texe\u00ef\",\"description\":\"Turn your IT into Business\",\"publisher\":{\"@id\":\"https:\\\/\\\/texei.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/texei.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/texei.com\\\/#organization\",\"name\":\"Texe\u00ef\",\"url\":\"https:\\\/\\\/texei.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/texei.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/logo-essai-1.jpg\",\"contentUrl\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/logo-essai-1.jpg\",\"width\":2560,\"height\":1102,\"caption\":\"Texe\u00ef\"},\"image\":{\"@id\":\"https:\\\/\\\/texei.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/texei.com\\\/#\\\/schema\\\/person\\\/082ce6d13635571cae4161f1d4f5a9a7\",\"name\":\"Fabien Taillon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/avatar_user_5_1766076207-96x96.png\",\"url\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/avatar_user_5_1766076207-96x96.png\",\"contentUrl\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/avatar_user_5_1766076207-96x96.png\",\"caption\":\"Fabien Taillon\"},\"url\":\"https:\\\/\\\/texei.com\\\/en\\\/author\\\/fabient\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Easily load data into your Scratch Org (or Sandbox): Part 2 - Texe\u00ef","description":"This is a two parts blog series : Part 1 is focused on a simple command to export\/import data, while Part 2 handles with more advanced use ...","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:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/","og_locale":"en_US","og_type":"article","og_title":"Easily load data into your Scratch Org (or Sandbox): Part 2","og_description":"This is a two parts blog series : Part 1 is focused on a simple command to export\/import data, while Part 2 handles with more advanced use ...","og_url":"https:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/","og_site_name":"Texe\u00ef","article_published_time":"2020-05-13T12:07:43+00:00","article_modified_time":"2023-08-15T15:11:52+00:00","og_image":[{"width":800,"height":450,"url":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2020\/05\/1_QrltGbeVXdeBYBFT9jWhWw.png","type":"image\/png"}],"author":"Fabien Taillon","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/#article","isPartOf":{"@id":"https:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/"},"author":{"name":"Fabien Taillon","@id":"https:\/\/texei.com\/#\/schema\/person\/082ce6d13635571cae4161f1d4f5a9a7"},"headline":"Easily load data into your Scratch Org (or Sandbox): Part 2","datePublished":"2020-05-13T12:07:43+00:00","dateModified":"2023-08-15T15:11:52+00:00","mainEntityOfPage":{"@id":"https:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/"},"wordCount":1527,"publisher":{"@id":"https:\/\/texei.com\/#organization"},"image":{"@id":"https:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/#primaryimage"},"thumbnailUrl":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2020\/05\/1_QrltGbeVXdeBYBFT9jWhWw.png","articleSection":["Advices"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/","url":"https:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/","name":"Easily load data into your Scratch Org (or Sandbox): Part 2 - Texe\u00ef","isPartOf":{"@id":"https:\/\/texei.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/#primaryimage"},"image":{"@id":"https:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/#primaryimage"},"thumbnailUrl":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2020\/05\/1_QrltGbeVXdeBYBFT9jWhWw.png","datePublished":"2020-05-13T12:07:43+00:00","dateModified":"2023-08-15T15:11:52+00:00","description":"This is a two parts blog series : Part 1 is focused on a simple command to export\/import data, while Part 2 handles with more advanced use ...","breadcrumb":{"@id":"https:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/#primaryimage","url":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2020\/05\/1_QrltGbeVXdeBYBFT9jWhWw.png","contentUrl":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2020\/05\/1_QrltGbeVXdeBYBFT9jWhWw.png","width":800,"height":450,"caption":"Easily load data into your Scratch Org - Part 2"},{"@type":"BreadcrumbList","@id":"https:\/\/texei.com\/en\/advices\/easily-load-data-into-your-scratch-org-or-sandbox-part-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/texei.com\/"},{"@type":"ListItem","position":2,"name":"Advices","item":"https:\/\/texei.com\/en\/category\/advices\/"},{"@type":"ListItem","position":3,"name":"Easily load data into your Scratch Org (or Sandbox): Part 2"}]},{"@type":"WebSite","@id":"https:\/\/texei.com\/#website","url":"https:\/\/texei.com\/","name":"Texe\u00ef","description":"Turn your IT into Business","publisher":{"@id":"https:\/\/texei.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/texei.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/texei.com\/#organization","name":"Texe\u00ef","url":"https:\/\/texei.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/texei.com\/#\/schema\/logo\/image\/","url":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2021\/03\/logo-essai-1.jpg","contentUrl":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2021\/03\/logo-essai-1.jpg","width":2560,"height":1102,"caption":"Texe\u00ef"},"image":{"@id":"https:\/\/texei.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/texei.com\/#\/schema\/person\/082ce6d13635571cae4161f1d4f5a9a7","name":"Fabien Taillon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2025\/12\/avatar_user_5_1766076207-96x96.png","url":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2025\/12\/avatar_user_5_1766076207-96x96.png","contentUrl":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2025\/12\/avatar_user_5_1766076207-96x96.png","caption":"Fabien Taillon"},"url":"https:\/\/texei.com\/en\/author\/fabient\/"}]}},"_links":{"self":[{"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/posts\/115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/comments?post=115"}],"version-history":[{"count":0,"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/posts\/115\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/media\/2203"}],"wp:attachment":[{"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/media?parent=115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/categories?post=115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/tags?post=115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}