I'm trying to insert Account and related contacts records in one org to another org.

In Org1 I exported Account and contacts here I'm trying to insert those records into another Org2

here I need created external id where can I create and how can I populate the values please help me.


  • 1
    What have you done so far? Where are you stuck? Note that using External Id is one route to loading tree data, but it's not the only one. You can use various third-party ETL tools, map Ids with VLOOKUP() or INDEX/MATCH(), or use sfdx force:data:tree:export if the volume is small enough. – David Reed May 28 '19 at 18:09

You'll need an external id field to upsert records. Upsert is a combination of update and insert and means updating records which have a matching value for the external id field, and creating new records if there isn't a matching value in the org you're upserting into.

You can make a field into an external id when you create it. It's best practice to make an external id field required and unique because duplicate values in the external id will cause errors when you try and upsert records.

You'll also need to make sure that the external id field exists in both Org1 and Org2.

Make a new field an external id

Populating the external id field depends on how many records you have. If it's only a handful, it may be easiest to add the external id field to your layout and set the values by hand. If it's many records, you might want to use something like Workbench: Update. Workbench will allow you to update records using a CSV of Id, ExternalId__c, meaning you can generate your external ids through another tool (e.g. Excel).

Not the answer you're looking for? Browse other questions tagged or ask your own question.