You need to sign in to do that
Don't have an account?
Daniel Rudman 7
Bulk API v2
Hi,
Thanks in advance for any help and advice. So we are building a data integration using Bulk API v2, but now we have a big concern as to how we can match up the record ID's returned for insert operations to the records which were sent.
https://developer.salesforce.com/docs/atlas.en-us.api_bulk_v2.meta/api_bulk_v2/get_job_successful_results.htm
Usage Notes
The order of records in the response is not guaranteed to match the ordering of records in the original job data.
First, not sure when exactly the order is not guaranteed. If all records insert succesfully, the order does seem to match.
Second, when some records fail, then the order of course does not match, because the failed records are now in the failed results endpoint.
So lets say you send in for insert:
Test account 1
Test account 2
Test account 3
And account 2 fails. then the success endpoint for bulk api v2 will return Test account 1 and Test account 3. The failure endpoint will return Test account 2. But there is no way to trace them to the original records we were inserting. how does Salesforce expect that to work?
With Bulk API v1 the results were returned in one list which matched up to the order of the records which were sent in, with the last containing both success and failure.
Is it possible to do this?
Thanks in advance for any help and advice. So we are building a data integration using Bulk API v2, but now we have a big concern as to how we can match up the record ID's returned for insert operations to the records which were sent.
https://developer.salesforce.com/docs/atlas.en-us.api_bulk_v2.meta/api_bulk_v2/get_job_successful_results.htm
Usage Notes
The order of records in the response is not guaranteed to match the ordering of records in the original job data.
First, not sure when exactly the order is not guaranteed. If all records insert succesfully, the order does seem to match.
Second, when some records fail, then the order of course does not match, because the failed records are now in the failed results endpoint.
So lets say you send in for insert:
Test account 1
Test account 2
Test account 3
And account 2 fails. then the success endpoint for bulk api v2 will return Test account 1 and Test account 3. The failure endpoint will return Test account 2. But there is no way to trace them to the original records we were inserting. how does Salesforce expect that to work?
With Bulk API v1 the results were returned in one list which matched up to the order of the records which were sent in, with the last containing both success and failure.
Is it possible to do this?
Greetings!
You can see the records/data that you wanted to insert under view results of the jobs on Bulk Jobs.Also,you should have the CSV file which will have the data that you wanted to insert into the salesforce in which you can check the data in case if you miss on the "View Results" link in salesforce.
Also,please refer the document (https://developer.salesforce.com/docs/atlas.en-us.api_bulk_v2.meta/api_bulk_v2/walkthrough_upload_data.htm) for the steps to insert the records in bulk.
Kindly let me know if it helps you and close your query by marking it as best answer so that it can help others in the future.
Warm Regards,
Shirisha Pathuri
If you can see any failed record in the file that you can see when you click on the View Results link.I would suggest you to copy the Id or record Name and look for that in the CSV file which you had with you to get the exact record and make changes accoridngly which is the only way to map the records.
Thank you!
So the question still stands unfortunately, how to uniquely match it up?
Do you have any other field like external Id or unique Id with which we can cut down the number of records and find the required one.
Thank you!
If any other Unique Id field is not present in an Object (Standard or Custom), which is quite common use case, the API seems to be unusable when there are mutiple records with same values (less probability in real environment but easy to create this scenario in test setup). Am I missing something here ?
Identify and retrying of failed INSERTs would be requirement of any application that intends to use this API.
Thanks,
Suhel