+ Start a Discussion
Thomas LettieriThomas Lettieri 

Using Data Loader with Lookups

I want to insert (using the dataloader with a csv file the dataloader generated) a set of Object A, and then insert (in the same way) a set of Object B which has a lookup to Object A

When inserting if I include the id it fails because it is an invalid type of ID (ID is org specific and I am transfering between two orgs).

Is there anyway of using data loader on objects that have lookups?  I cannot change the original records so I cannot use external IDs.
Matthew CokeMatthew Coke
insert object A, export to get the proper 18 digit Ids, link to object B using an external program (spreadsheet, whatever), import object B
Mahesh DMahesh D
Hi Thomas,

Option 1:

Importing Accounts and Contacts consists of a 2 step process when using the Data Loader. The first step is to import the Accounts that the contacts are associated to.Then use the salesforce id's generated by the system and associate them to the contacts in your contact file. 

Step 1 - Import Accounts:

Create a CSV file for the Accountrecords and include all necessary data. Use the data loader with the Insert function to upload the companies to Propertybase. After the import is completed a success file will be generated containing the Salesforce ID's that have be created for each record. This ID is key for matching the contact records in the system.

Step 2 - Match Accounts to Contacts and Import 

Utilizing the success file with the ID's match them to the contact record. This is can be done using the Vlookup function in Microsoft Excel. It is possible to use the Account name found in the contact file to use as the identifier for the ID mapping. The field to be map the contact ID's to in Propertybase to is called: AccountID. Once this is complete save a CSV file and import the contacts. 

The contacts will then be associated to the Accounts correctly.
------------------------------------------------------------------------------------------------------------------------------------------------------

Option 2:

How do I use an External ID to import related records?

http://help.salesforce.com/HTViewSolution?id=000002783

http://blog.jeffdouglas.com/2010/05/07/using-exernal-id-fields-in-salesforce/


-------------------------------------------------------------------------------------------------------------------------------------------------

Option 3:

Using dataloader.io, the ~ steps: Import your parent Account records.
  1. Select the Import option
  2. Select the import operation type – upsert.
  3. Select the object you wish to import data into Account.
  4. Verify Mapping Between Fields
  5. Click Next Upload the CSV file you wish to import by clicking the Upload CSV button.
Import your child Contact records, ensure the Account field contain the name of your Accounts.
  1. Select the Import option
  2. Select the import operation type – upsert.
  3. Select the object you wish to import data into Contact.
  4. Verify Mapping Between Fields
  5. You'll need to Lookup the Account Ids you've just imported, on the mapping file, select your Account field, and choose the "Lookup via Account" Account Name.
  6. Click Next Upload the CSV file you wish to import by clicking the Upload CSV button.
Note, because you are upserting from an export ensure your upsert files do not contain any system fields.

Please go through the useful information below:

https://help.propertybase.com/hc/en-us/articles/203187983-Data-Loader-Part-3-Importing-new-records

https://www.youtube.com/watch?v=VMW94CuoEYo&index=1&list=PLnobS_RgN7JZaD_Fq8uh3b2AA8olsj1Qk&nohtml5=False

https://www.newfangled.com/things-consider-importing-data-salesforce/


Please do let me know if it helps you.

Regards,
Mahesh