function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kathyanikathyani 

Load data which have fields as look up - data loader only takes ID for that field

Hi,
I want to insert data into salesforce using dataloader. So I created an excel file with data. Few of the fields are look up fields so my excel file has the ID as the value in that field. This works for me but I want to share this data with my team mates and we will need to change the ID for these fields corresponding to their instance. ID is a foreign key/look up in another table.
Also data loader takes only ID for these look up fields. If I have a label value instead of ID it does not insert data.


Example
Field1Field1Field3Field4

SubjectActionLabel
a0C80000001Qfxma0C80000001PqoEa0C80000001Qfxetext1


FieldInquiry SuspendedUsage Email
a0C80000001QjWEa0C80000001PqoEa0C80000001Qfxetext2

FieldGeneral SuspendedUsage Email
In this example Field1, Field2, Field3 are lookup fields in another table. They are foreign keys. So if my team mate wants to use the same data to export into their instance this would not work because they will have a different set of IDs on their instance.

If we have  huge data then it would not be possible to load same data. How can we achieve this so that one set of data can be used across multiple instances.

Quick response would be appreciated.



thanks,
kathyani
jeremy_rossjeremy_ross
If you want an ID that will be the same across orgs, you'll have to create a custom field and supply your own ID that will be used as the key.

Jeremy
kathyanikathyani
ID is the record id in the example that I provided above. ID is a record Id from the look up table. Only when I have this ID in my excel sheet data loader successfully imports data. So its not a custom field but it is the record id from the table.
jeremy_rossjeremy_ross
When you load the data into another org, you start with the lookup tables.  For each table, you must keep a map of the old ID values (from your org) to the new ID values (in your mate's org).  Then when you load the table which references the lookup values, you use your map to translate from the old IDs to new IDs.

Jeremy
kathyanikathyani
So I have to create a map of old ids and new ids(another instance) manually. We might have lot of data then we would have to key in all those ids(both old and new) in the map.
That would take sometime. Is that the only way to export data to another instance (data involving look up tables)
kathyanikathyani
BTW really appreciate for the quick replies which you are sending. Thanks for helping.
jeremy_rossjeremy_ross
I'm not suggesting you do it manually.  If you use the data loader to insert the records, it outputs the original record plus the new ID.  So there's your map.
kathyanikathyani
I am not sure I am understanding it correctly. Would you mind explaining me again?

In data loader map matches the columns from csv file to salesforce table fields. So its only for one instance.

The goal is to upload the same data on every instance (team mate's salesforce). The IDS in the above example are for my SF instance. These Ids are foreign keys but they refer
to some other table. Data works fine in my instance because I copied Ids from my instance. These ids are also pointing to my look up table.

In my team mates instance they have a different set of Ids. So in the data I have to change ids according to their instance. Their ids are also foreign keys to another table.
These Ids are different from that of mine.

Ids are record ids which gets automatically generated when a record is created in SF. So we have no control to edit them.
jeremy_rossjeremy_ross
Load the lookup files (including the old id) using the data loader.  Do not map the old id in the mapping step.  Data loader will write a success file which contains all the original fields (including the old id) and the new ID that was generated.  This success file can be used later when you need to do old->new id lookups.


Message Edited by jeremy_ross on 10-23-2008 01:07 PM
kathyanikathyani
Ok I was able to create the success file (did not map the ids for those lookup fields) and new ids are populated in the look up fields. Now using this file I tried to load this in
another SF instance but it did not work. (because Id is different from that of ids from success file)

What did you mean by "This success file can be used later when you need to do old->new id lookups."