tSalesforceInput
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 generally available.
Basic settings
Property Type |
Select the way the connection details
This property is not available when other connection component is selected |
Connection Component |
Select the component whose connection details |
Connection type |
Select the type of the connection from the drop-down list, either Basic or OAuth.
|
Module Name |
Click the […] button next to the field and in the |
Schema and Edit schema |
A schema is a row description. It defines the number of fields (columns) to Click Edit schema to make changes to the schema.
In this component the schema is related to the Module Warning:
To retrieve a column from a linked module it is necessary to
This component offers the This dynamic schema |
Query Mode |
Select the query mode from the drop-down list, either
|
Condition |
Enter the query used to select the data to be extracted between This field 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 |
Guess schema |
Click this button to generate the schema columns based on the query specified This button is available only when the Manual Query check box is Note that there are some limitations you |
Guess query |
Click this button to generate the query in the Full SOQL query For more information about how to set the module and schema correctly when This button is available only when the Manual Query check box is Note that there are some limitations you |
Include deleted records |
Select this check box to query all the records, including the This check box is available only when Query is selected from the Query Mode drop-down list. |
Advanced settings
Salesforce URL |
Enter the Webservice URL required to connect to |
Need compression |
Select this check box to activate SOAP message compression, which can result in increased |
Trace HTTP message |
Select this check box to output the HTTP interactions on the console. This check box 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 check box 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 This field is available only when Query is selected from the Query |
Timeout (milliseconds) |
Enter the intended number of query timeout in Salesforce.com. |
Use Proxy |
Select this check box to use a proxy server, and in the Host, Port, User Id, and Password fields displayed, specify |
Batch Size |
Enter the number of registrations in each processed batch. This field is available only when Query is selected from the Query |
Normalize Delimiter |
Enter the characters, strings or regular expressions used to This field is available only when Query is selected from the Query |
Column Name Delimiter |
Enter the characters, strings or regular expressions used to This field is available only when Query is selected from the Query |
Enable PK Chunking |
Select this check box to enable PK (Primary Key, i.e., the object’s record ID) This check box is available only when Bulk is selected |
tStatCatcher Statistics |
Select this check box to gather the Job processing metadata at the Job level |
Global Variables
Global Variables |
NB_LINE: the number of rows read by an input component or
ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see |
Usage
Usage rule |
This component is usually used as a start component of a Job or Subjob and it |
How to set schema for the guess query feature of tSalesforceInput
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.
-
Set the module name with the name of the object specified in the
FROM
clause,Account
and
Mother__c
for above examples. -
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
, andBillingCity
for the three
fields.For the second example, you need to create two columns
Name__c
andLastName__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
, a child-to-parent relationship query with custom
Daughter__c
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.
-
Set the module name with the name of the object specified in the
FROM
clause,Contact
and
Daughter__c
in above examples. -
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
. -
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
. -
Set the type of each column.
The schema for the first example should be set like this:
And the schema for the second example should be set like this:
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
, a parent-to-child relationship query with standard object
Account
and fields, and -
SELECT LastName__c, (SELECT FirstName__c FROM Daughters__r) FROM
, a parent-to-child relationship query with custom object
Mother__c
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.
-
Set the module name with the name of the object specified in the outer query
FROM
clause,Account
and
Mother__c
in above examples. -
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 fieldsName
andOwner.Name
after the outerSELECT
, 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 fieldLastName__c
after the outer
SELECT
, and the fieldFirstName__c
after the subquerySELECT
. -
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
outerSELECT
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. -
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 subqueryFROM
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. -
Set the type of each column.
The schema for the first example should be set like this:
And the schema for the second example should be set like this:
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.
Scenario: Extracting data from a Salesforce database using the SOQL query
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
-
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. -
Connect the tSalesforceInput component to the
tLogRow component using a Row > Main
connection.
Configuring the components
-
Double-click the tSalesforceInput component
to open its Basic settings view. -
In the User Id, Password and Security Key
fields, enter the user authentication information required to access
Salesforce. -
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. -
Click the […] button next to Edit schema to open the schema dialog box.
-
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. -
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:1SELECT Id, Name, IsWon, FiscalYear, Account.Name FROM OpportunityNote 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. -
Double-click the 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.
Executing the Job
- Press Ctrl + S to save your Job.
-
Press F6 to execute your Job.
As shown above, the data in the Opportunity
object is selected and displayed on the console.