- Are you struggling to fit your migrated data into your target Salesforce environment?
- Is there a need for creating multiple fields?
- Don’t want to lose the data but don’t have the fields to migrate it to?
If the answers to most or all of your questions is ‘yes’, then this article can help you achieve all the above without creating any new fields and without suffering any data loss.
Where can you use this technique?
- Lack of fields on the Target as compared to the Source environment
- Data model does not match between the two environments
- Do not want to create new fields in the Target environment
- Do not have a separate custom object to hold the data
Figure 1 Salesforce data model not matching
How to achieve this?
We will extract all the data from the source environment and insert it into the Description field of the Target environment using TALEND.
- We have migrated the data of Productsobject (OpportunityLineItem) from Source org.into a Description field (Special_Instruction__c) of Opportunity object in Target org.
- We are using Excel to extract data from Source environment and a Salesforce connection to push the data on the Target environment. We can also create a Salesforce connection for both the environments (Recommended way).
Step 1: Create a Salesforce connection.
For this you need 3 parameters:
- Security Token
Figure 2 Create a Salesforce connection
You need to enter all the credentials for the Source environment.
Note:If you are connecting to a UAT environment be sure to change the URL in the tSalesforceConnection component.
Step 2:In this step we need to extract the data from both the source files.
Figure 3 Job Design in TALEND
To achieve the above process first you need two files:
- Source File:In this file you need all the Product data (Opportunity Line Item data) along with the OpportunityId
- Target File:In this file you need the Opportunity Id from the Target
Step 3:In this step we need to:
- Insert the two files into the tMap
- Apply an inner join between the two files.
- Concatenate all the product data into a single variable and add a null check to all the fields before inserting them into variables.
- Insert the variable into the Opportunity field.
Figure 4 tMap Design in TALEND
In this method we have added “|” to separate the data you can choose another symbol as per your convenience.
Note: Select the same selections in the tMap as highlighted above.
Step 4: After all the description is concatenated add a tDenormalize to concatenate the records with the same Opportunity Id based on the Description field.
Step 5:In this step use a tSalesforceOutput component to update the description field for the respective opportunity.
Finally attaching the complete job for reference.
More ways to implement the above approach:
- Extracting data from Salesforce rather than Excel
- Using other objects like Account, Contact etc.
- Pushing data into Salesforce with Excel
- Merging Product Data with Billing data
In a nutshell, we can say that whether your migration is for small or large data, you need to process your data in an efficient way. In your data migration journey, Talend can be your partner for ensuring hassle-free migration.