Deployment Step: Data

Updated 1 month ago by Copado Solutions

Copado allows you to create and manage deployment steps when executing a deployment. There are several types of deployment steps. In this article we will go over the Data deployment step.

A Data deployment step allows you to deploy objects based on a SOQL query, where the object represents an SOQL table and each field a table row. The external Id field enables you to identify a record. This is very helpful when you are performing several deployments, as it will allow you to distinguish the record and update it, rather than create a duplicated record.

When deploying an external Id field, make sure you also deploy the relevant permissions in order to ensure you have access to this field in the environment to which you are deploying.

You can use a Data deployment step to sequentially load data using several Data deployment steps. Additionally, you can deploy related records using multiple Data deployment steps. For instance, if you’re deploying account records and you want to include related contacts, invoices and invoice Items, you will then need to create 4 Data deployment steps in the following order:

Step 1: SELECT External_Id__c, Name from Account

Step 2: SELECT External_Id__c, LastName, AccountId.External_Id__c from Contact

Step 3: SELECT External_Id__c, Date__c, Number__c, Account__r.External_Id__c, Billing_Contact__r.External_Id__c from Invoice__c

Step 4: SELECT External_Id__c, Quantity__c, Unit_Price__c, Invoice__r.External_Id__c from Invoice_Item__c

Please note that, when deploying related records, you will need to reference the external Id field of the parent record in the query.

For example, in the following query you need to reference the Account.External_Id__c field instead of simply referencing the AccountId field:

SELECT External_Id__c, LastName, AccountId.External_Id__c from Contact

You can make Environment Variables apply to Data deployments by adding ":applyEnv=true" to the step name.

An important consideration when working with Data deployment steps is that, since records are updated in the deployment, you have to be careful not to remove any relevant data. It is recommended that you do a backup before proceeding with the Data deployment step.

Additional Information

  • The batch size is 200. However, it is possible to change the batch size by adding the following text to the Step name ":batch=N" where N is greater than 0 and less than 200.
    Here is an example of a step name where the batch size has been set to 20: "Accounts :batch=20".
  • The fields included in the query are expected to exist in the destination org (with the same API names and data types).
  • Data transformation is currently not supported.


How did we do?