You need to sign in to do that
Don't have an account?
![ntnng ntnng](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Using Data Loader to load records into object with master details relationship
Hi,
I need to load data into two objects. I am able to load data into one object using the data loader. The second object has a master-details relationship with the first object so I need to have the unique record id of the records of first object in the CSV file. How can I add those record id's to my CSV file?
If in a Master-detail relationship, you first need to insert all master records.
Then run a report to get all the Inserted Master record Id's and export them your machine.
Now to insert detail object records, you need to associate them with Master Record ID.
A possible approcah would be use VLOOkUP function in Excel to populate the Id's.
Once you have the ID's populated then you can insert Detail records using data loader.
Hope it helps.
Sales4ce
All Answers
If in a Master-detail relationship, you first need to insert all master records.
Then run a report to get all the Inserted Master record Id's and export them your machine.
Now to insert detail object records, you need to associate them with Master Record ID.
A possible approcah would be use VLOOkUP function in Excel to populate the Id's.
Once you have the ID's populated then you can insert Detail records using data loader.
Hope it helps.
Sales4ce
When you import the data using dataloader, it generates a success file. Open that file and you will be able to see an extra column where you will find the salesforce ids related to the each record. You can map these ids on the second objects csv file using vlookup.
Hope this helps.
That was cool! I did not know that before.
It definitely helps to reduce the task running reports and exporting them.
Sales4ce
I used Pentaho Kettle to achieve this and decided to share.
1) As a source, select Salesforce Input to get the name-id lookup table (using a soql query) and
2) select Stream lookup to transform a Name (for example) in an Id, the same result you'd get with VLOOKUP using Excel
The query was written to simply retrieve all results (probably there's a better way to do it):
As for the Stream Lookup just select the Salesforce Input as Lookup step.
Cheers,
Filipe
Volunteer
Amnesty International Portugal
Identify the field that contains the unique record IDs in the first object. This field is usually called Id or Record ID.
Export the unique record IDs from the first object. You can do this using a variety of tools, such as the Salesforce Data Loader or a SQL query.
Add the unique record IDs to the CSV file. You can do this manually, or you can use a programming language such as Python or R to automate the process.
Once you have added the unique record IDs to the CSV file, you can load the data into the second object using the data loader. The data loader will match the unique record IDs in the CSV file to the unique record IDs in the second object, ensuring that the data is loaded correctly.
best cell phone plans for college students (https://infimobile.com/student-discount)