One Star

Salesforce Lookup in Talend

Hi all,
I'm inexperienced with Talend and this is my first object.
I'm creating a Job that take data from Oracle View and import it in Salesforce in two different objects related via a lookup field.
I have created a new Job, put a tOracleInput with the view, put a tMap, and put the two tSalesforceOutput (Account and custom object). Account and this custom object are related via a lookup relationship.
Now, how can I manage this relationship also with Talend ? 
The target is to import some data of the view in the Account and other data in the custom object keeping the relationship.
Thanks in advance
2 REPLIES
Moderator

Re: Salesforce Lookup in Talend

Hi,
Could you please post your current job design screenshot into forum? Which will be helpful for us to understand your requirement.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Salesforce Lookup in Talend

Hi,
Suppose your custom object API name is ChildObject__c and the lookup field is Account__c.
In tSalesforceOutput component, you have 2 choices depending on the action you choose:
1- Insert: in this case you must know the Account Id you want to join with the record in ChildObject__c. This id may result of a preceding insert or a select, then, using a tMap you must place the correct value into the Account__c field (standard join process on Talend side).
2- Upsert: you may associate ChildObject__c with the corresponding Account using Account external id (a field of your choice you must declare as an external id unique on Salesforce side - lets say "AccountExternalId__c" for this example). Here, go to Advanced settings tab of tSalesforceOutput component and fulfill the relationships mapping area like this:

With upsert you may also proceed like for insert.

Hope this helps,
TRF