Scenario: Extracting data from a Salesforce database using the SOQL query - 6.3

Talend Open Studio for Big Data Components Reference Guide

Talend Open Studio for Big Data
Data Governance
Data Quality and Preparation
Design and Development
Talend Studio

This scenario describes a two-component Job used to extract a specific set of data from an object in a Salesforce database.

Setting up the Job

  1. Create a new Job and add a tSalesforceInput component and a tLogRow component by typing their names on the design workspace or dropping them from the Palette.

  2. Connect the tSalesforceInput component to the tLogRow component using a Row > Main connection.

Configuring the components

  1. Double-click the tSalesforceInput 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 Opportunity.

  4. Click the [...] button next to Edit schema to open the schema dialog box.

  5. Remove all columns except Id, Name, IsWon, and Fiscal Year. Then add another column Opportunity_Account_Name of String type.

    Note that to retrieve a column from a linked object, it is necessary to define the name of the column in a particular manner in the schema editor. The correct syntax is NameofCurrentObject_NameofLinkedObject_NameofColumnofInterest. Hence, in this example, to retrieve the Name column in the Account object, the name of the fifth column must be Opportunity_Account_Name. If this syntax is not respected, the data from the linked object will not be returned.

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

  6. Select the Manual Query check box and in the Full SOQL query string field displayed, enter your SOQL statement used to search the data to be retrieved. In this example, the statement is as follows:

    SELECT Id, Name, IsWon, FiscalYear, Account.Name FROM Opportunity

    Note that to return a column from a linked object, the correct syntax of the column name in a SOQL statement is NameofCurrentObject.NameofColumnofInterest. Hence, in this example, the fifth column name in the SOQL statement is Account.Name.

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

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

Executing the Job

  1. Press Ctrl + S to save your Job.

  2. Press F6 to execute your Job.

    As shown above, the data in the Opportunity object is selected and displayed on the console.