Scenario 2: Gathering erroneous data while inserting data into a Salesforce object - 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

In this scenario, the account data in a local file SalesforceAccount.txt is inserted into the Salesforce Account object, and both the inserted data and the erroneous data are collected and displayed on the console.

The content of the input file SalesforceAccount.txt is as follows:

Name;ParentId;Phone;Fax
Burlington Textiles Corp of America;;(336) 222-7000;(336) 222-8000
Dickenson plc;; (785) 241-6200;(785) 241-6201
GenePoint;;(650) 867-3450;(650) 867-9895
Edge Communications;talend;(512) 757-6000;(512) 757-9000
Grand Hotels & Resorts Ltd;talend;(312) 596-1000;(312) 596-1500

Setting up the Job

  1. Create a new Job and add a tFileInputDelimited component, a tSalesforceOutput 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 tSalesforceOutput component using a Row > Main connection.

  3. Link the tSalesforceOutput component to the first tLogRow component using a Row > Main connection.

  4. Link the tSalesforceOutput component to the second tLogRow component using a Row > Reject connection.

    Note that the Row > Reject connection for the tSalesforceOutput component is available only when the Extend Insert and Cease on error check boxes in the Advanced settings view are cleared.

Configuring the components

  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 source 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 tSalesforceOutput component to open its Basic settings view.

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

  6. 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.

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

  7. Click Sync columns to retrieve the schema from the preceding component and accept the propagation prompted by the pop-up dialog box.

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

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

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

Executing the Job

  1. Press Ctrl + S to save the Job.

  2. Press F6 to run the Job.

    As shown above, two records with incorrect ParentId values are rejected and displayed in the tLogRow_2 table on the console.