How to use external Id to Upsert data in salesforce using Talend

How to use external Id to Upsert data in salesforce using Talend

Please find below links for the installation and introduction about Talend. https://blogs.absyz.com/2018/10/16/introduction-to-talend-integration-tool/ https://blogs.absyz.com/2018/10/17/how-to-export-data-from-salesforce-using-talend/

What is an external Id?

External Id is a very interesting feature given by Salesforce. It is very helpful when we are importing data from external system without duplicates. It references an ID (record Identifier) from external system. Only 3 types of fields are allowed to be used as an external Id.

They are

  • Email
  • Text
  • Number

Benefits of using External Id field:

  1. We can directly upsert data using external field. (Upsert is combination of insert and update, if the record already exists in the system it will update else it will insert a new record)
  2. We can create parent child record without querying for parent record Id
  3. We can use external Id fields in SOQL

How to make a field as an external Id?

While creating a field you will probably see the option to make a field external Id.

externalimage

How to upsert data with external Id in Talend?

Let see how we can upsert contacts by populating account lookup value using external id in talend.

I have created external id fields in contact and account.

External id field in contact: External_Number__c

External id field in Account: Account_Number_external__c

1.Create a new job in talend

job_Creation

2. Drag and drop tFileOutputDelimited from palette to workspace. Choose the file name and separator.

fileoutputdelimited

3. Drop and drop tMap from pallet to workspace. Add an output table and add columns in it. Make sure you are adding the API names from salesforce.

Tmap

4. Drag & drop tSalesforceOutput from pallet. Give your credential like username, password & security token. Select module as contact as we are doing the dml on contacts. Select output action as upsert, then you will find an option to select external key choose external key from the list.

SFOutput

5. Go to advanced settings you will see Relationship mapping for Upsert

lookupUpsert

Description for each column:

Column name of talend schema: select the column name where parent external key was copied.

Lookup field Name: API name of account lookup field from contact objects

Lookup relationship field name: relationship name for standard fields it is same lookup field. For custom fields append __r .

Module name: The parent object name

External id name: external id field from parent object. Here it is from account.

6. Save the changes and run the job.

The overall job looks like this : 

overallJob

 Results in Salesforce: 

result_sf

Leave a Comment

Your email address will not be published. Required fields are marked *

Recent Posts

top 5 benefits of using salesforce for high tech industry infographic
Top 5 Benefits of using Salesforce for High-Tech Industry
salesforce world tour essentials dubai
Salesforce World Tour Essentials Dubai | May 16, 2024
simplifying npl the magic of natural language processing
Simplifying NLP: The Magic of Natural Language Processing
streamlining-salesforce deployment with gearset a devops revolution Part 2
Streamlining Salesforce Deployment with Gearset: A DevOps Revolution (Part 2)
streamlining-salesforce deployment with gearset a devops revolution Part 1
Streamlining Salesforce Deployment with Gearset: A DevOps Revolution (Part1)
Scroll to Top