Scenario: Inserting transformed bulk data into Salesforce - 6.3

Talend Open Studio for Big Data Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for Big Data
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

This scenario describes a six-component Job that transforms the data in the file SalesforceAccount.txt used in Scenario 2: Gathering erroneous data while inserting data into a Salesforce object, stores the transformed data in a CSV file suitable for bulk processing, and then loads the transformed data into Salesforce from the CSV file and displays the Job execution results on the console.

Setting up the Job

  1. Create a new Job and add a tFileInputDelimited component, a tMap component, a tSalesforceOutputBulk component, a tSalesforceBulkExec component and two tLogRow components by typing their names on the design workspace or dropping them from the Palette.

  2. Link the tFileInputDelimited component to the tMap component using a Row > Main connection.

  3. Link the tMap component to the tSalesforceOutputBulk component using a Row > *New Output* (Main) connection. In the pop-up dialog box, enter the name of the output connection. In this example, it is out.

  4. Link the tSalesforceBulkExec component to the first tLogRow component using a Row > Main connection.

  5. Link the tSalesforceBulkExec component to the second tLogRow component using a Row > Reject connection.

  6. Link the tFileInputDelimited component to the tSalesforceBulkExec component using a Trigger > OnSubjobOk connection.

Configuring the components

Preparing the bulk loading file

  1. Double-click the tFileInputDelimited component to open its Basic settings view.

  2. In the File name/Stream field, browse to or enter the path to the input data file. In this example, it is D:/SalesforceAccount.txt.

    In the Header field, type in 1 to skip the header row in the beginning of the file.

  3. Click the [...] button next to Edit schema and in the pop-up schema dialog box, define the schema by adding four columns Name, ParentId, Phone and Fax of String type.

    Click OK to save the changes and close the dialog box.

  4. Double-click the tMap component to open its map editor and set the transformation.

  5. Select all columns from the row1 input table and drop them to the out output table.

    Append .toUpperCase() in the Expression cell for the Name column in the out output table.

    Click OK to validate the transformation and close the map editor.

  6. Double-click the tSalesforceOutputBulk component to open its Basic settings view.

  7. In the Bulk File Path field, browse to or enter the path to the CSV file that will store the transformed data for bulk processing.

Loading data into Salesforce from the file

  1. Double-click the tSalesforceBulkExec component to open its Basic settings view.

  2. In the User Id, Password and Security Key fields, enter the user authentication information required to access Salesforce.

  3. Click the [...] button next to the Module Name field and in the pop-up dialog box, select the object you want to access. In this example, it is Account.

  4. Click the [...] button next to Edit schema and in the pop-up dialog box, remove all columns except Name, ParentId, Phone and Fax.

    Click OK to save the changes and accept the propagation prompted by the pop-up dialog box.

  5. In the Bulk File Path field, browse to or enter the path to the CSV file that stores the transformed data for bulk processing.

  6. Double-click the first tLogRow component to open its Basic settings view.

  7. In the Mode area, select Table (print values in cells of a table) for better readability of the results.

  8. Do the same to configure the second tLogRow component.

Executing the Job

  1. Press Ctrl + S to save the Job.

  2. Press F6 to execute the Job.

    You can check the execution result on the Run console.