tSalesforceOutput
service.
tSalesforceOutput Standard properties
These properties are used to configure tSalesforceOutput running in the Standard Job framework.
The Standard
tSalesforceOutput 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.
Click Sync columns to retrieve the schema from This component offers the This dynamic schema |
Output Action |
Select one of the following operations to be
performed from the 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 |
Use HTTP Chunked |
Select this check box to use the HTTP chunked data transfer mechanism. |
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 |
Relationship mapping for upsert |
Click the [+]
This table is available only when UPSERT is selected from the Output |
Extend Insert |
Select this check box to transfer the output data in batches. In the |
Cease on Error |
Select the check box to stop the execution of the Job when an error Clear the check box to skip any rows on error and complete the process for The Extend Insert check box needs to be cleared when |
Retrieve Id |
Select this check box to allow Salesforce.com to return the This check box is available only when When this check box is selected and the
|
Ignore Null |
Select this check box to ignore NULL values. This check box is available only when UPDATE or UPSERT is |
Log File Name |
Specify the path to the log file that holds all error logs. |
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
NB_SUCCESS: the number of rows successfully processed.
NB_REJECT: the number of rows rejected. This is an After
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 can be used as an end component |
Scenario 1: Deleting data from the Account object in Salesforce
This scenario describes a three-component Job that removes the record added into the
Salesforce Account object in Scenario: Using OAuth2 to log in to Salesforce.com.
Setting up the Job
-
Create a new Job and add a tSalesforceConnection component, a tSalesforceInput component and a tSalesforceOutput component by typing their names on the design
workspace or dropping them from the Palette. -
Link the tSalesforceInput component to the
tSalesforceOutput component using a
Row > Main
connection. -
Link the tSalesforceConnection component to
the tSalesforceInput component using a
Trigger > OnSubjobOk connection.
Configuring the components
-
Double-click the tSalesforceConnection
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. -
Double-click the tSalesforceInput component
to open its Basic settings view. -
In the drop-down list next to the Property
Type drop-down list, select the tSalesforceConnection component to reuse the connection created
by it.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. -
In the Condition field, enter the condition
expression used to filter the record to be deleted between double quotation
marks. In this example, it is name=’Talend’,
which is used to filter the account record whose name is Talend. -
Double-click the tSalesforceOutput component
to open its Basic settings view. -
In the drop-down list next to the Property
Type drop-down list, select the tSalesforceConnection component to reuse the connection created
by it.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. -
From the Output Action drop-down list, select
the operation to be carried out. In this example, select DELETE to delete the Talend account
retrieved in the previous component.
Executing the Job
- Press Ctrl + S to save the Job.
- Press F6 to execute the Job.
-
Go to the Salesforce.com and check the content of the Account object.
As shown above, the Talend account has
already been deleted from the server.
Scenario 2: Gathering erroneous data while inserting data into a Salesforce
object
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:
1 2 3 4 5 6 |
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
-
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. -
Link the tFileInputDelimited component to the
tSalesforceOutput component using a
Row > Main
connection. -
Link the tSalesforceOutput component to the
first tLogRow component using a Row > Main
connection. -
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
-
Double-click the tFileInputDelimited
component to open its Basic settings
view. -
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. -
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. -
Double-click the tSalesforceOutput 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 Account.Click OK to save the settings and close the
dialog box. -
Click Sync columns to retrieve the schema
from the preceding component and accept the propagation prompted by the pop-up
dialog box. -
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. -
Do the same to configure the second tLogRow
component.
Executing the Job
- Press Ctrl + S to save the Job.
-
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.
Scenario 3: Inserting the Account ID values from an Excel File into the Salesforce
Contact object
In this scenario, the Account ID values from an Excel file are inserted into the
Salesforce Contact object based on the matching of the
LastName and Name
fields.
Setting up the Job
-
Create a new Job and add a tFileInputExcel
component, a tSalesforceInput component, a
tMap component and a tSalesforceOutput component by typing their names on the design
workspace or dropping them from the Palette. -
Link the tFileInputExcel component to the
tMap component using a Row > Main
connection. -
Link the tSalesforceInput component to the
tMap component using a Row > Main
connection. The connection is automatically changed to a Lookup flow. -
Link the tMap component to the tSalesforceOutput component using a Row > *New Output*
(Main) connection. In the pop-up dialog box, enter the name of
the output connection. In this example, it is out.
Configuring the components
Configuring the source Excel input
-
Double-click the tFileInputExcel component to
open its Basic settings view. -
In the File name/Stream field, browse to or
enter the path to the Excel file that contains the Account ID data to be
inserted. In this example, it is D:/AccountIdInput.xls. And the content of the file is as
follows: -
Select the All sheets check box to retrieve
the data of the entire Excel file. -
In the Header field, enter 1 to skip one row in the beginning of the
file. -
Click the […] button next to Edit schema and in the pop-up schema dialog box,
define the schema by adding three columns AccountId, LastName and
Name of String type.Click OK to save the settings and close the
dialog box.
Configuring the destination object and the desired operation
-
Double-click the tSalesforceOutput 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 Contact.
Configuring the lookup source and establishing the mapping relations
-
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 Contact.Click OK to save the settings and close the
dialog box. In the pop-up dialog box, click Yes
to propagate the schema to the next component. -
Double-click the tMap component to open its
map editor. -
Select the LastName column from the
row1 table and drop it to its counterpart
column in the row2 table.Do the same to drop the Name column in the
row1 table to its counterpart column in
the row2 table.This way, the data from the Excel file will be checked against their
counterparts in the Contact object. -
Select the AccountId column from the
row1 table and drop it to its counterpart
column in the out table.Do the same to drop the LastName column in
the row1 table to its counterpart column in
the out table.This way, qualified data from the Excel file will be passed to their
counterpart fields in the out table. - Click OK to close the map editor.
Executing the Job
- Press Ctrl + S to save your Job.
-
Press F6 to run the Job.
Scenario 4: Upserting the Contact object based on mapping relationships with the external
IDs in the Account object
This scenario upserts the records in the Contact object
based on mapping (matching) against the external IDs in the Account object.
Setting up the Job
-
Create a new Job and add a tSalesforceConnection component, two tFixedFlowInput components, two tSalesforceInput components, two tSalesforceOutput components and two tLogRow components by typing their names on the design workspace
or dropping them from the Palette. -
Link the first tFixedFlowInput component to
the first tSalesforceOutput component using a
Row > Main
connection. - Do the same to link the first tSalesforceInput component to the first tLogRow component, the second tFixedFlowInput component to the second tSalesforceOutput component, and the second tSalesforceInput component to the second tLogRow component.
-
Link the tSalesforceConnection component to
the first tFixedFlowInput component using a
Trigger > OnSubjobOk connection. -
Do the same to link the first tFixedFlowInput
component to the first tSalesforceInput
component, the first tSalesforceInput component
to the second tFixedFlowInput component, and
the second tFixedFlowInput component to the
second tSalesforceInput component.
Configuring the components
Connecting to Salesforce
component to open its Basic settings
view.
fields, enter the user authentication information required to access
Salesforce.
Inserting the external ID values into the Account object
-
Double-click the first tFixedFlowInput
component to open its Basic settings
view. -
Click the […] button next to Edit schema and in the pop-up schema dialog box,
define the schema by adding three columns Name, AccountID__c and
AccountBizLicense__c of String
type.Note that AccountID__c and AccountBizLicense__c are customized fields in the
Account object, with the attribute of
external ID.Click OK to save the changes and close the
dialog box. -
In the Mode area, select Use Inline Content (delimited file) and enter the
data below in the Content field.12Google;US666;C.A.666Talend;FR888;Paris888 -
Double-click the first tSalesforceOutput
component to open its Basic settings
view. -
In the drop-down list next to the Property
Type drop-down list, select the tSalesforceConnection component to reuse the connection created
by it. -
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.
Retrieving the external ID values from the Account object
-
Double-click the first tSalesforceInput
component to open its Basic settings
view. -
In the drop-down list next to the Property
Type drop-down list, select the tSalesforceConnection component to reuse the connection created
by it. -
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 the […] button next to Edit schema and in the pop-up schema dialog box,
define the schema by adding three columns Name, AccountID__c and
AccountBizLicense__c of String type, same
as the schema of the first tFixedFlowInput
component.Click OK to save the changes and close the
dialog box. -
In the Condition field, enter the filter
statement between double quotation marks. In this example, it is"name
.
like 'Tal%' OR name like 'Goo%'" -
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 results.
Upserting the emails into the Contact object upon the external ID
matching
-
Double-click the second tFixedFlowInput
component to open its Basic settings
view. -
Click the […] button next to Edit schema and in the pop-up schema dialog box,
define the schema by adding four columns Email, AccountBizLicense,
AccountID and LastName of String type.Click OK to save the changes and close the
dialog box. -
In the Mode area, select Use Inline Content (delimited file) and enter the
data below in the Content field.12andy@talend.com;Paris888;FR888;Andyanderson@talend.com;C.A.666;US666;Anderson -
Double-click the second tSalesforceOutput
component to open its Basic settings
view. -
In the drop-down list next to the Property
Type drop-down list, select the tSalesforceConnection component to reuse the connection created
by it. -
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 Contact. -
Select UPSERT from the Output Action drop-down list, and then Email from the Upsert Key
Column drop-down list. -
Go to the Advanced settings view to set the
relationship mapping.Click the [+] button below the Relationship mapping for upsert table to add two
lines.Click the cells under the Column name of Talend
Schema column and from the drop-down list select AccountBizLicense and AccountID respectively.Enter the lookup relationship fields in the Lookup field
name column, Account and
Account__r respectively.Enter the lookup module names in the Module
name column, Account for the
both.Enter the external ID fields in the External id
name column, AccountBizLicense__c and AccountID__c respectively, which are the customized fields (with
the external ID attribute) in the Account
object.Note that Column name of Talend Schema refers
to the fields in the schema of the component preceding tSalesforceOutput. Such columns are intended to match against
the external ID fields specified in the External id
name column, which are the fields of the lookup module specified
in the Module name column. Lookup field name refers to the lookup relationship
fields of the module selected from the Module
list in the Basic settings view. They are
intended to establish relationship with the lookup module specified in the
Module name column. For how to define the
lookup relationship fields and how to provide their correct names in the
Lookup field name column, go to the
Salesforce website and launch the Salesforce Data Loader application for proper
actions and information.
Retrieving the emails from the Contact object
-
Double-click the second tSalesforceInput
component to open its Basic settings
view. -
In the drop-down list next to the Property
Type drop-down list, select the tSalesforceConnection component to reuse the connection created
by it. -
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 Contact. -
Click the […] button next to Edit schema to open the schema dialog box.
Remove all columns except LastName and
Email.Click OK to save the changes and close the
dialog box. -
In the Condition field, enter the filter
statement between double quotation marks. In this example, it is"Email
.
like 'And%'" -
Double-click the second tLogRow component to
open its Basic settings view.In the Mode area, select the Table (print values in cells of a table) radio button
for better readability of the results.
Executing the Job
- Press Ctrl + S to save the Job.
-
Press F6 to run the Job.
As shown above, the insert and upsert actions have been completed
successfully.