July 31, 2023

tSalesforceInput – Docs for ESB Sales Force 7.x

tSalesforceInput

Retrieves data from a Salesforce object based on a query.

tSalesforceInput Standard properties

These properties are used to configure tSalesforceInput running
in the Standard Job framework.

The Standard
tSalesforceInput component belongs to the Business
and the Cloud families.

The component in this framework is available in all Talend
products
.

Basic settings

Property Type

Select the way the connection details
will be set.

  • Built-In: The connection details will be set
    locally for this component. You need to specify the values for all
    related connection properties manually.

  • Repository: The connection details stored
    centrally in Repository > Metadata will be reused by this component. You need to click
    the […] button next to it and in the pop-up
    Repository Content dialog box, select the
    connection details to be reused, and all related connection
    properties will be automatically filled in.

This property is not available when other connection component is selected
from the Connection Component drop-down list.

Connection Component

Select the component that opens the database connection to be reused by this
component.

Connection type

Select the type of the connection from the drop-down list. The
connection properties will vary according to the connection type you choose.

  • Basic: select this option to
    access Salesforce by entering your Salesforce username and password.

  • OAuth: select this option to
    access Salesforce using OAuth (Open Authorization) 2.0 protocol to authenticate the
    user. From the Oauth2 flow type drop-down
    list displayed, you need to choose an OAuth 2.0 authentication flow type, either
    Json Web Token Flow or Implicit Flow (Deprecated) (User Agent Flow). This
    way, you need to create a connected app in Salesforce to configure a Salesforce
    authentication provider.

    For more information about the OAuth authentication flow, see Authenticate Apps with OAuth.

    For more information about how to create a connected app in
    Salesforce, see Create a Connected App.

User Id

The Salesforce username.

This property is available
only when the Basic connection type is selected.

Password

The Salesforce password associated with the username.

This property is available
only when the Basic connection type is selected.

Security Token

The Salesforce security token. For more information, see Reset Your Security Token.

This property is available
only when the Basic connection type is selected.

Issuer

The OAuth Consumer Key, generated
when your connected app is created and shown in the connected app detail page in
Salesforce. For more information, see Create a Connected App.

This property is available only
when the OAuth Json Web Token Flow type is selected.

Subject

The Salesforce username.

This property is available only
when the OAuth Json Web Token Flow type is selected.

Audience

Json Web Token audience.

You can set your own Json Web Token
audience.

This property is available only
when OAuth is selected from the Connection type
drop-down list and Json Web Token Flow is selected from the the
Oauth2 flow type drop-down list.

Expiration time (in seconds)

The expiration time of the assertion (in seconds) within five
minutes.

This property is available only
when the OAuth Json Web Token Flow type is selected.

Key store

The path to the keystore file in Java Keystore (JKS) format.

The keystore file can be generated by creating a certificate signed by
Salesforce and then exporting it to keystore. For more information, see Generate a Self-Signed Certificate.

This property is available only
when the OAuth Json Web Token Flow type is selected.

Key store password

The keystore password.

This property is available only
when the OAuth Json Web Token Flow type is selected.

Certificate alias

The unique name of the certificate signed by Salesforce.

This property is available only
when the OAuth Json Web Token Flow type is selected.

Client Id

The OAuth Consumer Key, generated
when your connected app is created and shown in the connected app detail page in
Salesforce. For more information, see Create a Connected App.

This property is available
only when the OAuth Implicit Flow type is selected.

Client Secret

The OAuth Consumer Secret, generated when your connected app is
created and shown in the connected app detail page in Salesforce. For more information,
see Create a Connected App.

This property is available
only when the OAuth Implicit Flow type is selected.

Callback Host

The host value in the OAuth authentication callback URL that is
defined during the creation of a connected app and will be shown in the API (Enable OAuth Settings) area of the connected app
detail page in Salesforce.

This property is available
only when the OAuth Implicit Flow type is selected.

Callback Port

The port value in the OAuth authentication callback URL that is
defined during the creation of a connected app and will be shown in the API (Enable OAuth Settings) area of the connected app
detail page in Salesforce.

This property is available
only when the OAuth Implicit Flow type is selected.

Token File

The path to the token file that stores the refresh token used to get
the access token without authorization.

This property is available
only when the OAuth Implicit Flow type is selected.

Module Name

Click the […] button next to
the field and in the dialog box displayed, select the module that will be used or select
the Use custom object check box and specify the
module name in the Object Name field.

Schema and Edit schema

A schema is a row description. It defines the number of fields
(columns) to be processed and passed on to the next component. When you create a Spark
Job, avoid the reserved word line when naming the
fields.

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.

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

This
component offers the advantage of the dynamic schema feature. This allows you to
retrieve unknown columns from source files or to copy batches of columns from a source
without mapping each column individually. For further information about dynamic schemas,
see
Talend Studio

User Guide.

This dynamic schema feature is designed for the purpose of
retrieving unknown columns of a module and is recommended to be used for this purpose only; it
is not recommended for the use of creating modules.

Query Mode

Select the query mode from the drop-down list, either
Query or Bulk.

  • Query: the
    ordinary query.

  • Bulk: the bulk
    query used to query large data sets efficiently and reduce the number of
    API requests.

Condition

Enter the query used to select the data to be extracted between
double quotation marks, for example, “name=’Talend'” or
“name like ‘%talend_user%'”.

This property
is not available when the Manual Query check box is
selected.

Manual Query

Select this check box and in the Full SOQL query string field displayed, enter the full SOQL
(Salesforce Object Query Language) statement used to select the data to be
retrieved between double quotation marks. For more information about the SOQL,
see Salesforce Object Query
Language (SOQL)
.

Guess schema

Click this button to generate the schema columns based on the query specified
in the Full SOQL query string field.

This property
is available only when the Manual Query check box is
selected.

Note that there are some
limitations you should be aware of when using this feature. Please refer to the Know
Limitations section in Release Notes for more detailed information.

Guess query

Click this button to generate the query in the Full SOQL query
string
field based on the defined module and schema.

For more information about how to set the module and schema correctly when
generating the SOQL queries, see How to set schema for the guess query feature of tSalesforceInput.

This property
is available only when the Manual Query check box is
selected.

Note that there are some
limitations you should be aware of when using this feature. Please refer to the Know
Limitations section in Release Notes for more detailed information.

Include deleted
records

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

This property is
available only when Query is selected from the
Query Mode drop-down list.

Advanced settings

Salesforce URL

The Webservice URL required to connect to Salesforce.

API version

The Salesforce API version.

This property is available only when the
OAuth connection type is selected.

Use or save the connection
session

Select this check box and in the Session
directory
field displayed, specify the path to the connection session file
to be saved or used.

This session file can be shared by different Jobs to retrieve a
connection session as long as the correct user ID is provided by the component. This
way, you do not need to connect to the server to retrieve the session.

When an expired session is detected, if the correct connection
information (the user ID, password, and security key) is provided, the component will
connect to the server to retrieve the new session information and update the connection
session file.

This property is available
only when the Basic connection type is selected.

Need compression

Select this check box to activate SOAP message compression, which can
result in increased performance levels.

Trace HTTP message

Select this check box to
output the HTTP interactions on the console.

This property is
available only when Bulk is selected from the
Query Mode drop-down list.

Use HTTP Chunked

Select this check box to use the
HTTP chunked data transfer mechanism.

This property is
available only when Query is selected from the
Query Mode drop-down list.

Client Id

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

Timeout

Enter the intended number of query timeout in milliseconds in
Salesforce.

Use Proxy

Select this check box to use a proxy server, and in the Host, Port,
User Id, and Password fields displayed, specify the connection parameters of the proxy
server.

Batch Size

Enter the number of registrations in each processed batch.

This property is
available only when Query is selected from the
Query Mode drop-down list.

Normalize Delimiter

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

This property is
available only when Query is selected from the
Query Mode drop-down list.

Column Name Delimiter

Enter the 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.

This property is
available only when Query is selected from the
Query Mode drop-down list.

Safety Switch

Clear this check box if the length of any column of the module to be queried is
greater than 100,000 characters. By default, this check box is selected to
prevent excessive memory usage.

This property is
available only when Bulk is selected from the
Query Mode drop-down list.

Complete Job timeout

The timeout value, in seconds, within which your bulk query Job must be
completed. By default, the value is set to 0, which
means there is no time limit for your Job to complete.

Salesforce has its own limit for bulk query. If it takes time longer than
Salesforce’s timeout limit to process a batch, the batch will be placed in a
queue and processed later, and thus it might take too much time for the Job to
execute. In this case, you can define the Complete Job timeout value to make
your Job end in advance. For more information about Salesforce’s own limit, see
Bulk API Limits – Batch processing
time
.

This property is
available only when Bulk is selected from the
Query Mode drop-down list.

Enable PK Chunking

Select this check box to enable PK (Primary Key, i.e., the object’s record ID)
chunking when extracting large amounts of records or when the query
consistently times out. In the Chunk size field
displayed, specify the number of records within the ID boundaries for each
chunk. For more information, see Use PK Chunking to Extract Large Data Sets
from Salesforce
.

This property is
available only when Bulk is selected from the
Query Mode drop-down list.

tStatCatcher Statistics

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

Global Variables

NB_LINE

The number of rows processed. 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.

Usage

Usage rule

This component is usually used as a start component of a Job or
subJob and it always needs an output link.

How to set schema for the guess query feature of tSalesforceInput

tSalesforceInput allows you to generate SOQL queries, with
both standard objects and fields and custom objects and fields, based on the defined module
and schema. This section demonstrates how to set the module and schema when generating an SOQL
query.

There are two types of SOQL queries: simple query and relationship query.

Simple query retrieves data from only one object. For more information about how to set the
module and schema for generating simple queries, see How to set schema for generating the simple query.

Relationship query retrieves data from more than a single type of object, including
child-to-parent and parent-to-child relationship queries.

For more information about how to set the module and schema for generating child-to-parent
relationship queries, see How to set schema for generating the child-to-parent relationship query.

For more information about how to set the module and schema for generating parent-to-child
relationship queries, see How to set schema for generating the parent-to-child relationship query.

Note that before setting the module name and schema columns for generating the relationship
query in the Basic settings view of
tSalesforceInput, you need to first identify the relationship type
(child-to-parent or parent-to-child) of the query to be generated, because the methods of
setting the schema column names for these two kinds of relationship queries are somewhat
different. The main difference between the child-to-parent and parent-to-child relationship
queries is that the parent-to-child relationship query is specified by using the subquery
enclosed in parentheses, while the child-to-parent relationship query is not. For more
information about the relationship queries in SOQL and how to identify the relationship
queries, see Relationship Queries.

How to set schema for generating the simple query

This section demonstrates how to set the module name and schema columns for generating
the simple query.

The following two simple query examples will be used for demonstration purpose in the
following steps.

  • SELECT Id, Name, BillingCity FROM Account, a simple query with
    standard object and fields, and

  • SELECT Name__c, LastName__c FROM Mother__c, a simple query with
    custom object and fields.

  1. Set the module name with the name of the object specified in the
    FROM clause, Account and
    Mother__c for above examples.
  2. Create a column for each field in the field list (separated by commas) after
    SELECT in the schema dialog box and set the column name
    with the field name.

    For the first example, you need to create three columns Id,
    Name, and BillingCity for the three
    fields.

    For the second example, you need to create two columns
    Name__c and LastName__c for the two
    fields.

How to set schema for generating the child-to-parent relationship query

This section demonstrates how to set the module name and schema columns for
generating a child-to-parent relationship query.

The following two child-to-parent relationship query examples will be used for
demonstration purpose in the following steps.

  • SELECT Name, Account.Name, Account.Owner.Name FROM Contact, a
    child-to-parent relationship query with standard object and fields, and

  • SELECT Id, FirstName__c, MotherOfDaughter__r.FirstName__c FROM
    Daughter__c
    , a child-to-parent relationship query with custom
    object and fields.

    Note that here you must use the relationship name with __r
    instead of __c. For more information, see Understanding Relationship Names, Custom
    Objects, and Custom Fields
    .

  1. Set the module name with the name of the object specified in the
    FROM clause, Contact and
    Daughter__c in above examples.
  2. Create a column for each field in the field list (separated by commas) after
    SELECT in the schema dialog box.

    For the first example, you need to create three columns for the three fields
    Name, Account.Name, and
    Account.Owner.Name.

    For the second example, you need to create three columns for the three fields
    Id, FirstName__c, and
    MotherOfDaughter__r.FirstName__c.

  3. Set the name of each column with the name of each field and replace all dots in
    the column name with underscore characters.

    For the first example, the names of the three columns are set to
    Name, Account_Name, and
    Account_Owner_Name.

    For the second example, the names of the three columns are set to
    Id, FirstName__c, and
    MotherOfDaughter__r_FirstName__c.

  4. Set the type of each column.

    The schema for the first example should be set like this:

    tSalesforceInput_1.png

    And the schema for the second example should be set like this:

    tSalesforceInput_2.png

    Note that the underscore character ‘_’ is
    used as a separator between the relationship name and the field name in
    Talend
    schema, so only the underscore character ‘_’ that goes after ‘__r’ or ‘__c’
    will be replaced by the dot character ‘.’ when generating the query. If the
    underscore character ‘_’ is a part of any custom name in the schema, for
    example, Contact_custom_field__c, which should be
    Contact.custom_field__c in the query, you need to
    replace ‘_’ in the generated query with ‘.’ manually.

How to set schema for generating the parent-to-child relationship query

This section demonstrates how to set the module name and schema columns for
generating a parent-to-child relationship query.

The following two parent-to-child relationship query examples will be used for
demonstration purpose in the following steps.

  • SELECT Name, Owner.Name (SELECT CreatedBy.Name FROM Notes) FROM
    Account
    , a parent-to-child relationship query with standard object
    and fields, and

  • SELECT LastName__c, (SELECT FirstName__c FROM Daughters__r) FROM
    Mother__c
    , a parent-to-child relationship query with custom object
    and fields.

    Note that here you must use the relationship name with __r
    instead of __c. For more information, see Understanding Relationship Names, Custom
    Objects, and Custom Fields
    .

  1. Set the module name with the name of the object specified in the outer query
    FROM clause, Account and
    Mother__c in above examples.
  2. Create a column for each field (inclulding the fields in subquery) after
    SELECT in the schema dialog box.

    For the first example, you need to create three columns for the three fields,
    including two fields Name and Owner.Name
    after the outer SELECT, and one field
    CreatedBy.Name after the subquery
    SELECT.

    For the second example, you need to create two columns for the two fields,
    including the field LastName__c after the outer
    SELECT, and the field FirstName__c
    after the subquery SELECT.

  3. For the fields in the outer SELECT clause, which are outside
    parentheses, set the name of each column with the name of each field and replace
    all dots in the column name with underscore characters.

    For the first example, the column names for the two fields
    Name and Owner.Name in the
    outer SELECT clause are set to Name
    and Owner_Name.

    For the second example, there is no dot in the field name, so the column name
    is same as the field name.

  4. For the fields in the subquery SELECT, construct the column
    names using the pattern <$XXX>_records_<$YYY>, where
    <$XXX> corresponds to the name of the object specified
    in the subquery FROM clause, and <$YYY>
    will be the field name with all dots replaced by underscore characters.

    For the first example, the column name for the field
    CreatedBy.Name in the subquery is set to
    Notes_records_CreatedBy_Name.

    For the second example, the column name for the field
    FirstName__c in the subquery is set to
    Daughters__r_records_FirstName__c.

  5. Set the type of each column.

    The schema for the first example should be set like this:

    tSalesforceInput_3.png

    And the schema for the second example should be set like this:

    tSalesforceInput_4.png

    Note that the underscore character ‘_’ is
    used as a separator between the relationship name and the field name in
    Talend
    schema, so only the underscore character ‘_’ that goes after ‘__r’ or ‘__c’
    will be replaced by the dot character ‘.’ when generating the query. If the
    underscore character ‘_’ is a part of any custom name in the schema, for
    example, Contact_custom_field__c, which should be
    Contact.custom_field__c in the query, you need to
    replace ‘_’ in the generated query with ‘.’ manually.


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