August 17, 2023

tSalesforceInput – Docs for ESB 5.x

tSalesforceInput

tSalesForceInput.png

tSalesforceInput Properties

Component family

Business/Cloud

 

Function

tSalesforceInput connects to an
object of a Salesforce database via the relevant Web service.

Purpose

Allows to extract data from a Salesforce DB based on a
query.

Basic settings

Property type

Either Built-in or Repository.

Since version 5.6, both the Built-In mode and the Repository mode are
available in any of the Talend solutions.

 

 

Built-in: No property data stored
centrally.

 

 

Repository: Select the repository
file where properties are stored. The fields that come after are
pre-filled in using the fetched data.

 

Save_Icon.png

Click this icon to open a connection wizard and store the Excel
file connection parameters you set in the component Basic settings view.

For more information about setting up and storing file connection
parameters, see Talend Studio
User Guide.

 

 Use an existing
connection

Select this check box and in the Component List click the
relevant connection component to reuse the connection details you already defined.

Note

When a Job contains the parent Job and the child Job, Component
list
presents only the connection components in the same Job
level.

 

Query mode

Two options are available: Query
and Bulk Query.

 

Login Type

Two options are available:

Basic: select this option to log
in to Salesforce.com by entering your Username/Password on tSalesforceConnection.

OAuth2: select this option to
access Salesforce.com by entering your Consumer key/Consumer Secret
on tSalesforceConnection. This way,
your Username/Password will not be exposed to tSalesforceConnection but extra work is required:

 

Salesforce Webservice URL

Enter the Webservice URL required to connect to the Salesforce
database.

 

Salesforce Version

Enter the Salesforce version you are using.

 

Username and
Password

Enter your Web service authentication details.

To enter the password, click the […] button next to the
password field, and then in the pop-up dialog box enter the password between double quotes
and click OK to save the settings.

 

Consumer Key and Consumer
Secret

Enter your OAuth authentication details. Such information is
available in the OAuth Settings
area of the Connected App that you have created at
Salesforce.com.

To enter the consumer secret, click the […] button next
to the consumer secret field, and then in the pop-up dialog box enter the consumer secret
between double quotes and click OK to save the
settings.

For what a Connected App is, see Connected Apps. For how to create a Connected App, see
Defining Remote Access Applications.

 

Callback Host and Callback
Port

Enter your OAuth authentication callback url. This url (both host
and port) is defined during the creation of a Connected App and will
be shown in the OAuth Settings area
of the Connected App.

 

Token File

Enter the token file name. It stores the refresh token that is
used to get the access token without authorization.

 

Timeout (milliseconds)

Type in the intended number of query timeout in
Salesforce.com.

Available when Query is selected
from the Query mode list.

 

Module

Select the relevant module in the list.

Note

If you select the Custom
Module
option, you display the Custom Module Name field where you
can enter the name of the module you want to connect to.

 

Schema and Edit
Schema

A schema is a row description. It defines the number of fields to be processed and passed on
to the next component. The schema is either Built-In or
stored remotely in the Repository.

Since version 5.6, both the Built-In mode and the Repository mode are
available in any of the Talend solutions.

Click Edit schema to make changes to the schema. If the
current schema is of the Repository type, three options are
available:

  • View schema: choose this option to view the
    schema only.

  • Change to built-in property: choose this option
    to change the schema to Built-in for local
    changes.

  • Update repository connection: choose this option to change
    the schema stored in the repository and decide whether to propagate the changes to
    all the Jobs upon completion. If you just want to propagate the changes to the
    current Job, you can select No upon completion and
    choose this schema metadata again in the [Repository
    Content]
    window.

In this component the schema is related to the Module
selected.

Warning

To retrieve a column from a linked
module it is necessary to define the column in a particular
manner in the Edit schema
view, otherwise the relationship query will not work. The
correct syntax is:
NameofCurrentModule_Nameof-


LinkedModule_NameofColumnof-


Interest

 

Query condition

Type in the query to select the data to be extracted. Example:
account_name= ‘Talend'

 

Maunal input of SOQL query

Select this check box to display the Query field where you can manually enter the desired
query.

 

Query all records (include deleted records)

Select this check box to query all the records, including the
deletions.

Available when Query is selected
from the Query mode list.

Advanced settings

Batch Size

Number of registrations in each processed batch.

Available when Query is selected
from the Query mode list.

 

Use Socks Proxy

Select this check box if you want to use a proxy server. Once
selected, you need enter the connection parameters that are the
host, the port, the username and the password of the Proxy you need
to use.

 

Normalize delimiter (for child relationship)

Characters, strings or regular expressions used to normalize the
data that is collected by queries set on different hierarchical
Salesforce objects.

Available when Query is selected
from the Query mode list.

 

Column name delimiter (for child relationship)

Characters, strings or regular expressions used to separate the
name of the parent object from the name of the child object when you
use a query on the hierarchical relations among the different
Salesforce objects.

Available when Query is selected
from the Query mode list.

 

Use Soap Compression

Select this check box to activate the SOAP compression.

Note

The compression of SOAP messages optimizes system performance,
in particular for the batch operations.

 

Output Http Trace Message

Select this check box to output the HTTP trace message.

Available when Bulk Query is
selected from the Query mode
list.

 

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at a
Job level as well as at each component level.

 

Client ID

Set the ID of the real user to differentiate between those who use
the same account and password to access the Salesforce
website.

Available when Query is selected
from the Query mode list.

Global Variables

NB_LINE: the number of rows read by an input component or
transferred to an output component. This is an After variable and it returns an
integer.

ERROR_MESSAGE: the error message generated by the
component when an error occurs. This is an After variable and it returns a string. This
variable functions only if the Die on error check box is
cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable
functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl +
Space
to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio
User Guide.

Usage

Usually used as a Start component. An output component is
required.

Log4j

The activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User
Guide
.

For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html.

Limitation

n/a

Scenario: Using queries to extract data from a Salesforce database

This scenario describes a four-component Job used to extract specific sets of data
from parent and child objects in a Salesforce database.

tSalesforceInputScenario1.png

Setting up the Job

  1. Drop two tSalesforceInput components and
    two tLogRow components onto the workspace.

  2. Connect each tSalesforceInput component
    to a tLogRow component using a Row > Main
    connection for each pair.

  3. Connect tSalesforceInput_1 to tSalesforceInput_2 using an OnSubjobOk connection.

Setting up the connection to the Salesforce server for the parent object

  1. Double-click tSalesforceInput_1 to set
    its Basic Settings in the Component tab.

    Use_Case_tSalesforceInput_1_Properties.png
  2. Enter the Salesforce WebService URL of
    the database you want to connect to in the corresponding field.

  3. Enter your authentication information in the corresponding Username and Password fields.

  4. Enter the desired query Timeout
    (milliseconds
    ) limit.

Setting the query and the schema for the parent object

  1. Select the Module (salesforce object) you
    want to query.

  2. Select the Manual input of SOQL Query
    check box and enter your query scripts in the enabled Query field.

    The query scripts you enter should follow the SOQL syntax.

  3. Select Built-In as the Schema and click […] next to Edit schema
    to open the schema editor.

    tSalesforceInput_Schema_Editor1.png

    In this example, the IsWon and
    FiscalYear columns in the query are located in the
    Opportunity module specified. The
    Name column is in a linked module called
    Account. To return a column from a linked module
    the correct syntax is to enter the name of the linked module, followed by
    the period character, then the name of the column of interest. Hence, the
    query required in this example is:

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

  4. Click the plus button to add a new column for the fields taken from the
    Name column in the Account
    module.

  5. Name this column Opportunity_Account_Name and click
    OK to save the changes.

    Warning

    To retrieve a column from a linked module, it is
    necessary to define the column in a particular manner in
    the Edit schema view. The
    correct syntax is:
    NameofCurrentModule_NameofLinkedModule_NameofColumnofInterest.
    Hence, in this example, the column must be named:
    Opportunity_Account_Name. If this syntax is not respected then the
    data from the linked table will not be returned.

Setting up the connection to the Salesforce server for the child object

  1. Double-click tSalesforceInput_2 to set
    its Basic settings in the Component tab.

    Use_Case_tSalesforceInput_2_Properties.png
  2. Enter the Salesforce WebService URL of
    the database you want to connect to in the corresponding field.

    The query scripts you enter must follow the SOQL syntax.

  3. Enter your authentication information in the corresponding Username and Password fields.

  4. Enter the desired query Timeout
    (milliseconds
    ) limit.

Setting the query and the schema for the child object

  1. Select the Module (salesforce object) you
    want to query.

  2. Select the Manual input of SOQL Query
    check box and enter your query scripts in the enabled Query field.

    In this example we want to extract the Id and
    CaseNumber fields from the
    Case module as well as the
    Name fields from the Account
    module. The query is therefore: .

    "SELECT Id, CaseNumber, Account.Name FROM Case"

  3. Select Built-In as the Schema and click […] next to Edit schema
    to open the schema editor.

    tSalesforceInput_Schema_Editor2.png
  4. Click the plus button to add a new column for the fields taken from the
    Name column in the Account
    module.

  5. Name this column Case_Account_Name and click
    OK to save the changes.

Job execution

  1. Click each tLogRow component and set
    their component properties in the Basic
    settings
    view as desired.

    In this example, there is no need to modify the tLogRow settings.

  2. Press Ctrl+S to save your Job and press
    F6 to execute it.

    The results are displayed in the Run
    tab:

    tSalesforceInput_RunTab.png

Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x