External IDs for Data Deploy

What is an External ID and why do you need it?

Garrett Meeks avatar
Written by Garrett Meeks
Updated over a week ago

In addition to seamlessly moving metadata between orgs, Data Deploy for Copado Essentials Plus is our solution to help with the migration of data between orgs. Data Deploy is our tool for helping to seed sandboxes or just deploy data up through a pipeline like your metadata with all of your object relationships maintained. However, moving data can be tricky, not only due to the cumbersome process of exporting, remapping, and importing objects using spreadsheets and a tool like Data Loader, but due to the undesired outcome of creating duplicate records in your target environment.

Data Deploy for Copado Essentials Plus can help solve these problems by allowing you to take advantage of an External ID. An External ID is a custom field that contains the External ID attribute, meaning that this field can be referenced by third-party applications, such as Copado Essentials Plus. To create an External ID field, you’ll simply check the “External ID” box on any field you want to give this attribute to.

This field will need to be implemented for all objects referenced by your data template in both the source and target orgs. The key feature of the External ID is that the values should match between environments so you can accurately prevent the creation of duplicates. The value that is inserted into this field can follow any convention that you like, or if you do not have a value in mind, our Data Deploy solution can create a value for you based on up to 3 fields of your choosing. Although selecting the fields is a simple process, be careful to choose fields that are unique to each record and that are unchanging between environments.

By implementing the External ID, this field will act as an anchor point between the source and target orgs of your data deployment, allowing Essentials to perform an "upsert". To perform this "upsert", during a data deployment, Copado Essentials Plus will search for a matching External ID between the source and target orgs. If a matching External ID is found, then the existing record is updated with the new information contained in the deployment, but if a matching External ID is not found, then a new record is created in the target environment, or inserted.

If an External ID is not utilized, there is an exponentially higher risk of introducing duplicate records during your data deployment. Without the External ID, Essentials will not check for pre-existing records and will simply create new records in the target org for everything that is deployed.

Did this answer your question?