Component family |
Business/Cloud |
|
Function |
tSalesforceoutput writes in an |
|
Purpose |
Allows to write data into a Salesforce DB. |
|
Basic settings |
Property type |
Either Built-in or Repository. Since version 5.6, both the Built-In mode and the Repository mode are |
|
|
Built-in: No property data is |
|
|
Repository: Select the Repository |
|
Use an existing connection |
Select this check box and in the Component List click the NoteWhen a Job contains the parent Job and the child Job, Component |
|
Login Type |
Two options are available: Basic: select this option to log OAuth2: select this option to
|
Salesforce Webservice URL |
Enter the Webservice URL required to connect to the Salesforce |
|
Salesforce Version |
Enter the Salesforce version you are using. |
|
|
Username and |
Enter your Web service authentication details. To enter the password, click the […] button next to the |
|
Consumer Key and Consumer |
Enter your OAuth authentication details. Such information is To enter the consumer secret, click the […] button next For what a Connected App is, see Connected Apps. For how to create a Connected App, see |
|
Callback Host and Callback |
Enter your OAuth authentication callback url. This url (both host |
|
Token File |
Enter the token file name. It stores the refresh token that is |
|
Timeout (milliseconds) |
Type in the intended number of query timeout in |
|
Action |
You can do any of the following operations on the data of the Insert: insert data. Update: update data. Delete: delete data.
Upsert: update and insert |
|
Upsert Key Column |
Specify the key column for the upsert operation. Available when Upsert is selected |
|
Module |
Select the relevant module in the list. NoteIf you select the Use Custom |
Schema and Edit |
A schema is a row description. It defines the number of fields to be processed and passed on Since version 5.6, both the Built-In mode and the Repository mode are Click Edit schema to make changes to the schema. If the
|
|
Advanced settings |
Extended Output |
This check box is selected by default. It allows to transfer |
|
Die on error |
This check box is selected by default. Clear the check box to skip NoteThe Reject link is available |
|
Error logging file |
If you want to create a file that holds all error logs, click the |
|
Use Socks Proxy |
Select this check box if you want to use a proxy server. Once |
|
Ignore NULL fields values |
Select this check box to ignore NULL values in Update or Upsert mode. |
|
Use Soap Compression |
Select this check box to activate the SOAP compression. NoteThe compression of SOAP messages optimizes system |
|
Retrieve inserted ID |
Select this check box to allow Salesforce.com to return the NoteThis option is available only when you have chosen insert action yet not in batch mode, |
|
tStatCatcher Statistics |
Select this check box to gather the Job processing metadata at a |
|
Client ID |
Set the ID of the real user to differentiate between those who use |
|
Relationship mapping for upsert |
Click the [+] button to add lines
Column name of Talend schema:
Lookup field name: lookup
Module name: name of the lookup
External id name: external ID field Note
|
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 Talend Studio |
|
Usage |
Used as an output component. An Input 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 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 |
This scenario describes a two-component Job that removes an entry from the Account
object.
-
Drop tSalesforceInput and tSalesforceOutput from the Palette onto the design workspace.
-
Connect the two components together using a Row > Main link.
Querying the content to be deleted
-
Double-click tSalesforceInput to display
its Basic settings view and define the
component properties. -
From the Property Type list, select
Repository if you have already stored
the connection to the salesforce server in the Metadata node of the Repository tree view. The property fields that follow are
automatically filled in. If you have not defined the server connection
locally in the Repository, fill in the details manually after selecting
Built-in from the Property Type list.For more information about how to create the salesforce metadata, see
Talend Studio User
Guide. -
In the Salesforce WebService URL field,
use the default URL of the Salesforce Web service or enter the URL you want
to access or select the Use an existing
connection check box to use an established connection. -
In the Username and Password fields, enter your login and password for the Web
service. -
Type in your intended query timeout in the Timeout
(milliseconds) field. In this example, use the default
number. -
From the Module list, select the object
you want to access, Account in this
example. -
From the Schema list, select Repository and then click the three-dot button to
open a dialog box where you can select the repository schema you want to use
for this component. If you have not defined your schema locally in the
metadata, select Built-in from the
Schema list and then click the
three-dot button next to the Edit schema
field to open the dialog box where you can set the schema manually. -
In the Query Condition field, enter the
query you want to apply. In this example, we want to retrieve the clients
whose names are sForce. To do this, we use the query:
"name='sForce'"
. -
For a more advanced query, select the Manual input of SOQL query and enter
the query manually.
Deleting the queried contents
-
Double-click tSalesforceOutput to display
its Basic settings view and define the
component properties. -
In the Salesforce WebService URL field,
use the default URL of the Salesforce Web service or enter the URL you want
to access. -
In the Username and Password fields, enter your login and password for the Web
service. -
Type in your intended query timeout in the Timeout
(milliseconds) field. In this example, use the default
number. -
From the Action list, select the
operation you want to carry out. In this example we select Delete to delete the sForce
account selected in the previous component. -
From the Module list, select the object
you want to access, Account in this
example. -
Click Sync columns to retrieve the schema
of the preceding component. -
Press Ctrl+S to save your Job.
In this scenario, data in a local file is inserted to the AdditionalNumber module. Meanwhile, erroneous data in that file is
collected via a Row > Reject link.
-
Drag and drop the following components from the Palette onto the workspace: tFileInputDelimited, tSalesforceOutput and two tLogRow components.
-
Rename tFileInputDelimited as DataToInsert, tSalesforceOutput as InsertToSalesforce, and the two tLogRow components as DataInserted as well as DataRejected respectively.
-
Link DataToInsert to InsertToSalesforce using a Row > Main
connection. -
Link InsertToSalesforce to DataInserted using a Row > Main
connection. -
Link InsertToSalesforce to DataRejected using a Row > Reject
connection.Note
Deselect the Extended Output and
Die on error check boxes in the
Advanced settings view of the
tSalesforceOutput component so that
the Reject link is available .
Configuring the data source
-
Double-click DataToInsert to open its
Basic settings view in the Component tab. -
In the Property Type drop-down list,
select Built-In.Note
You can select Repository from the
Property Type drop-down list to
fill in the relevant fields automatically if the relevant metadata has
been stored in the Repository. For more
information about Metadata, see the
Talend Studio
User Guide. -
In the File name/Stream field, type in
the path of the source file, for example, E:/salesforceout.csv. -
In the Header field, type in 1 to retrieve the column names. Keep the
default settings for other fields.
Configuring the module for data insertion
-
Double-click InsertToSalesforce to open
its Basic settings view in the Component tab. -
In the Username field, enter your
username, for example, cantoine@talend.com. -
In the Password field, enter your
password, for example, talendehmrEvHz2xZ8f2KlmTCymS0XU. -
In the Action drop-down list, select
insert. -
In the Module drop-down list, select
AdditionalNumber.Note
When linking the components earlier, the Extended Output and Die on
error check boxes have been deselected in the Advanced settings view so that the Reject link can appear. -
Keep the default settings for other fields.
In this scenario, the AccountIDs from an excel file are inserted to the Contact module at the www.salesforce.com
based on the
matching of LastName and Name fields.
-
Drag and drop the following components from the Palette onto the workspace: tFileInputExcel, tSalesforceIntput, tMap and
tSalesforceOutput. -
Rename tFileInputExcel as excel_source, tSalesforceIntput as load_salesforce_data, tMap
as match_and_output and tSalesforceOutput as insert_to_contact_module. -
Link the components using a Row >
Main connection.
Configuring the source excel input
-
Double-click excel_source to open its
Basic settings view in the Component tab. -
Click the […] button next to the
File name/Stream field to select the
source file.The content looks like:
-
Select the All sheets check box to
retrieve the data of the entire excel file. -
Enter 1 in the Header field as the first line lists the column
names. -
Click the […] button next to the
Edit schema field to open the schema
editor. -
Click the [+] button to add three
columns, AccountId, LastName and Name. -
Click OK to close the editor. Keep other
default settings as they are.
Configuring the destination module and the desired operation
-
Double-click insert_to_contact_module to
open its Basic settings view in the
Component tab. -
In the Username and Password fields, enter your authentication
credentials. -
Select insert in the Action list and Contact in the Module
list. -
Click the […] button next to Edit schema to open the schema editor.
-
Click
to copy all the columns from the output table to the
input table. -
Click OK to close the editor.
Configuring the lookup source and establishing the mapping relations
-
Double-click load_salesforce_data to open
its Basic settings view in the Component tab. -
In the Username and Password fields, enter your authentication
credentials. -
In the Module list, select the Contact module to retrieve data.
-
Clear the Query Condition field.
-
Double-click match_and_output to open its
map editor. -
Select fields LastName and Name from the table row1 and drop them next to their counterparts in the table
row2. This way, data from the excel
file will be checked against their counterparts in the Contact module. -
Select fields LastName and AccountID from the table row1 and drop them next to their counterparts in the table
id. This way, qualified data from the
excel file will be passed to their counterpart fields in the id table. -
Click OK to close the map editor.
This scenario upserts the records in the Contact module based on mapping (matching)
against the external IDs in the Account module:
-
Drop a tSalesforceConnection, two
tFixedFlowInput, two tSalesforceInput, two tSalesforceOutput and two tLogRow from the Palette
onto the workspace. -
Rename two tFixedFlowInput components as
external ids to insert and emails to upsert, two tSalesforceInput components as Contact
(in) and Account (in), two
tSalesforceOutput components as
Contact (out) and Account (out), and two tLogRow components as external ids
inserted and emails
upserted. -
Link tSalesforceConnection to external ids to insert using the OnSubjobOk trigger.
-
Link external ids to insert to Account (out) using a Row > Main
connection. -
Link external ids to insert to Account (in) using the OnSubjobOk trigger.
-
Link Account (in) to external ids inserted using a Row > Main
connection. -
Link Account (in) to emails to upsert using the OnSubjobOk trigger.
-
Link emails to upsert to Contact (out) using a Row > Main
connection. -
Link emails to upsert to Contact (in) using the OnSubjobOk trigger.
-
Link Contact (in) to emails upserted using a Row > Main
connection.
-
Double-click tSalesforceConnection to
open its Basic settings view.In the Username and Password fields, enter the authentication
credentials. -
Double-click external ids to insert to
open its Basic settings view. -
Click the Edit schema button to open the
schema editor.Click the [+] button to add three
columns, namely Name, AccountID__c and AccountBizLicense__c, all of the String type. Note that
AccountID__c and AccountBizLicense__c are customized fields in
the Account module, with the attribute of external ID.Click OK to close the editor.
Select the Use Inline Content (delimited
file) check box in the Mode
area and enter the data below in the Content box:12Google;US666;C.A.666Talend;FR888;Paris888 -
Double-click Account (out) to open its
Basic settings view.Select the Use an existing connection
check box.Select insert in the Action list and Account in the Module
list. -
Double-click Account (in) to open its
Basic settings view.Select the Use an existing connection
check box.Select Query in the Query mode list and Account
in the Module list.In the Query Condition box, enter the
filter statement:"name like 'Tal%' OR name like
.
'Goo%'" -
Click the Edit schema button to open the
schema editor.Click the [+] button to add three
columns, namely Name, AccountID__c and AccountBizLicense__c, all of the String type.Click OK to close the editor.
-
Double-click external ids inserted to
open its Basic settings view.Select the Table (print values in cells of a
table) check box for a better view of the results. -
Double-click emails to upsert to open its
Basic settings view. -
Click the Edit schema button to open the
schema editor.Click the [+] button to add four columns,
namely Email, AccountID, AccountBizLicense and LastName, all of the String type.Click OK to close the editor.
Select the Use Inline Content (delimited
file) check box in the Mode
area and enter the data below in the Content box:12andy@talend.com;Paris888;FR888;Andyanderson@talend.com;C.A.666;US666;Anderson -
Double-click Contact (out) to open its
Basic settings view.Select the Use an existing connection
check box.Select upsert in the Action list, Email in the Upsert Key
Column list and Contact in
the Module list.Go to the Advanced settings view to set
the relationship mapping:Click the [+] button to add two lines and
select AccountBizLicense and AccountID in the list under the Column name of Talend Schema column.Enter the lookup relationship fields in the Lookup
field name column, namely Account and Account__r.Enter the lookup module name in the Module
name column, namely Account.Enter the external id fields in the External id
name column, namely AccountBizLicense__c and AccountID__c, which are the customized fields (with the
external id attribute) in the Account
module.Note
-
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.
-
-
Double-click Contact (in) to open its
Basic settings view.Select the Use an existing connection
check box.Select Query in the Query mode list and Contact
in the Module list.In the Query Condition box, enter the
filter statement:"Email like 'And%'"
. -
Click the Edit schema button to open the
schema editor.Click the [+] button to add two columns,
namely LastName and Email, all of the String type.Click OK to close the editor.
-
Double-click emails upserted to open its
Basic settings view.Select the Table (print values in cells of a
table) check box for a better view of the results.