# tSalesforceOutput

Inserts, updates, upserts, or deletes data in a Salesforce object.

This component is not shipped with your Talend Studio by default. You need to install it using the Feature Manager. For more information, see [Installing features using the Feature Manager](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/install-features-to-talend-studio).

## 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 available in all Talend products.

## Basic settings

| Properties | Description |
| --- | --- |
| Property Type | Select the way the connection details<br>will be set.<br><br><ul> <li> <p> <span>Built-In</span>: The connection details will be set                                locally for this component. You need to specify the values for all                                related connection properties manually.</p> </li> <li> <p> <span>Repository</span>: The connection details stored                                centrally in <span><span>Repository</span><abbr> &gt; </abbr><span>Metadata</span></span> will be reused by this component. </p> <p>You need to click                                the <span>[...]</span> button next to it and in the pop-up                                    <span>Repository Content</span> dialog box, select the                                connection details to be reused, and all related connection                                properties will be automatically filled in.</p> </li> </ul><br><br>This property is not available when other connection component is selected from<br>the Connection Component dropdown list. |
| Component list | Select the component that opens the database connection to be reused by this<br>component. |
| Connection type | Select the type of the connection from the drop-down list. The connection<br>properties will vary according to the connection type you choose.<br><br><ul> <li> <p><span>Basic (deprecated)</span>: This option uses the legacy                        username, password, and security token ("SOAP API login()") to authenticate                        with Salesforce. Salesforce will retire support for SOAP API login() in API                        versions 31.0 through 64.0 starting with the Summer ‘27 release, and it is                        not available in API versions 65.0 and later. As such, Basic authentication                        is deprecated and may stop working in the near future regardless of the                        selected API version.</p> </li> <li> <p><span>OAuth</span>: This option uses OAuth (Open Authorization)                        2.0 protocol to authenticate the user with the <span>Json Web Token                           Flow</span> OAuth 2.0 authentication flow type. To use this option,                        you need to create a connected app in Salesforce to configure a Salesforce                        authentication provider.</p> <p>For more information about the OAuth authentication flow, see <a href="https://help.salesforce.com/articleView?id=remoteaccess_authenticate.htm&amp;type=5" target="_blank">Authenticate Apps with OAuth</a>.</p> <p>For more information about how to create a connected app in Salesforce, see                           <a href="https://help.salesforce.com/articleView?id=connected_app_create.htm&amp;type=5" target="_blank">Create a Connected App</a>.</p> </li> </ul> |
| User Id | The Salesforce username.<br><br>This property is available only when the Basic connection type is selected. |
| Password | The Salesforce password associated with the username.<br><br>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](https://help.salesforce.com/articleView?id=user_security_token.htm&type=5).<br><br>This property is available only when the Basic connection type is selected. |
| Issuer | The OAuth Consumer Key, generated when your<br>connected app is created and shown in the connected app detail page in Salesforce.<br>For more information, see [Create a Connected App](https://help.salesforce.com/articleView?id=connected_app_create.htm&type=5).<br><br>This property is available only when<br>the OAuth connection type is selected. |
| Subject | The Salesforce username.<br><br>This property is available only when<br>the OAuth connection type is selected. |
| Audience | Json Web Token audience.<br><br>You can set your own Json Web Token audience.<br><br>This property is available only when<br>the OAuth connection type is selected. |
| Expiration time (in seconds) | The expiration time of the assertion (in seconds) within five minutes.<br><br>This property is available only when<br>the OAuth connection type is selected. |
| Key store | The path to the keystore file in Java Keystore (JKS) format.<br><br>The keystore file can be generated by creating a certificate signed by Salesforce<br>and then exporting it to keystore. For more information, see [Generate a Self-Signed Certificate](https://help.salesforce.com/articleView?id=security_keys_creating.htm&type=5).<br><br>This property is available only when<br>the OAuth connection type is selected. |
| Key store password | The keystore password.<br><br>This property is available only when<br>the OAuth connection type is selected. |
| Certificate alias | The unique name of the certificate signed by Salesforce.<br><br>This property is available only when<br>the OAuth connection type is selected. |
| Mutual authentication | Select this option to enable mutual authentication for establishing connections to<br>Salesforce. For more information about mutual authentication in Salesforce, see<br>[Set Up a Mutual Authentication<br>Certificate](https://help.salesforce.com/s/articleView?id=sf.security_keys_uploading_mutual_auth_cert.htm&type=5).<br><br>If you are using this option:<br><br><ul> <li> <p>On the component side, use a <a href="https://help.qlik.com/talend/r/en-US/8.0/components/keystore/tsetkeystore">tSetKeystore</a> component to                           provide the mutual authentication keystore and keystore password.</p> </li> <li>On the metadata side, go to <span><span>Window</span><abbr> &gt; </abbr><span>Preferences</span><abbr> &gt; </abbr><span>Talend</span><abbr> &gt; </abbr><span>Security</span><abbr> &gt; </abbr><span>SSL</span></span>, and set the corresponding keystore configuration.</li> </ul><br><br>By default, this option is not selected. |
| Mutual auth keystore (Deprecated) | Enter the path to the mutual authentication keystore file, a password protected<br>file containing keys and certificates.<br><br>This option is deprecated, it is recommended to use a [tSetKeystore](https://help.qlik.com/talend/r/en-US/8.0/components/keystore/tsetkeystore) component to provide the mutual<br>authentication keystore and keystore password.<br><br>This option is available when both the Basic connection<br>type and the Mutual authentication check box are<br>selected. |
| Mutual auth keystore password | Enter the password for the mutual authentication keystore file.<br><br>This option is available when both the Basic connection<br>type and the Mutual authentication check box are<br>selected. |
| Module Name | Click the [...] button next to the field and in the dialog<br>box displayed, select the module that will be used or select the Use<br>custom object check box and specify the module name in the<br>Object Name field. |
| Schema and Edit schema | A schema is a row description. It defines the number of fields<br>(columns) to be processed and passed on to the next component. When you create a Spark<br>Job, avoid the reserved word line when naming the<br>fields.<br><br>Click Edit<br>schema to make changes to the schema. If the current schema is of the Repository type, three options are available:<br><br><ul> <li> <p> <span>View schema</span>: choose this                option to view the schema only.</p> </li> <li> <p> <span>Change to built-in property</span>:                choose this option to change the schema to <span>Built-in</span> for local changes.</p> </li> <li> <p> <span>Update repository connection</span>:                choose this option to change the schema stored in the repository and decide whether                to propagate the changes to all the Jobs upon completion.</p> <p>If you just want to                propagate the changes to the current Job, you can select <span>No</span> upon completion and choose this schema metadata                again in the <span>Repository Content</span>                window.</p> </li> </ul><br><br>Click Sync<br>columns to retrieve the schema from the previous component connected in the<br>Job.<br><br>This component offers the advantage of the<br>dynamic schema feature. This allows you to retrieve unknown columns from source<br>files or to copy batches of columns from a source without mapping each column<br>individually. For further information about dynamic schemas, see [Dynamic schema](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/dynamic-schema).<br><br>This dynamic schema feature is designed for the purpose of<br>retrieving unknown columns of a module and is recommended to be used for this purpose only; it<br>is not recommended for the use of creating modules. |
| Output Action | Select one of the following operations to be performed from the drop-down list.<br><br><ul> <li> <p> <span>INSERT</span>: insert one or more new records into                        Salesforce.</p> </li> <li> <p> <span>UPDATE</span>: update one or more existing records in                        Salesforce.</p> </li> <li> <p> <span>UPSERT</span>: create new records or update existing                        records. In the <span>Upsert Key Column</span> field displayed,                        specify the key column for the upsert operation. By selecting                           <span>Output upsert column</span>, a column named                           <span>UpsertColumnValue</span> will be added to the output                        schema. The column holds upsert key values and thus can be used to monitor                        the upsert key. You can select <span>Output upsert column</span>                        if the upsert key is a variable.</p> </li> <li> <p> <span>DELETE</span>: delete one or more records in Salesforce.</p> </li> </ul> |

## Advanced settings

| Properties | Description |
| --- | --- |
| Salesforce URL | The Webservice URL required to connect to Salesforce.<br><br>Information noteWarning: Due to a [breaking change](https://help.salesforce.com/s/articleView?id=release-notes.rn_security_mutual_authentication.htm&release=246&type=5) in the latest versions of<br>Salesforce, if you use the Basic connection type with<br>mutual authentication, you need to adjust the endpoint to prevent errors while<br>running the Job. Example:<br>https://MyDomainName.my.salesforce.com:8443/services/Soap/u/version |
| API version | The Salesforce API version.<br><br>This property is available only when<br>the OAuth connection type is selected. |
| Use or save the connection session | Select this check box and in the Session directory field<br>displayed, specify the path to the connection session file to be saved or<br>used.<br><br>This session file can be shared by different Jobs to retrieve a connection session<br>as long as the correct user ID is provided by the component. This way, you do not<br>need to connect to the server to retrieve the session.<br><br>When an expired session is detected, if the correct connection information (the<br>user ID, password, and security key) is provided, the component will connect to<br>the server to retrieve the new session information and update the connection<br>session file.<br><br>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<br>increased performance levels. |
| Use Http Chunked | Select this check box to use the HTTP<br>chunked data transfer mechanism. |
| Client Id | Enter the ID of the real user to differentiate between those who use the same<br>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 SOCKS proxy server, and in the<br>Host, Port, User<br>Id, and Password fields displayed, specify<br>the connection parameters of the SOCKS proxy server.<br><br>Information noteNote: To use a proxy of any allowed type (including HTTP proxy, HTTPS proxy, and<br>SOCKS proxy), use the tSetProxy component. |
| Relationship mapping for upsert | Click the<br>[+] button to add lines as needed and specify the<br>external ID fields in the input flow, the lookup relationship fields in the upsert<br>module, the lookup module as well as the external ID fields in the lookup<br>module.<br><br><ul> <li> <p><span>Column name of <span>Talend</span> Schema</span>: the name of the external ID field in the input flow. It                  refers to the fields in the schema of the preceding component. Such columns are                  intended to match against the external ID fields specified in the                     <span>External id name</span> column, which are the fields of the                  lookup module specified in the <span>Module name</span> column.</p> </li> <li> <p><span>Lookup                     field name</span>: the name of the lookup field. It refers to the lookup                  field of the module specified in the <span>Module Name</span> field in                  the <span>Basic settings</span> view. This column needs to be specified                  when there are NULL input values for it and the <span>Ignore Null</span>                  check box is cleared.</p> </li> <li> <p><span>Lookup relationship field name</span>: the name of the lookup                  relationship field. It refers to the lookup relationship fields of the module                  specified in the <span>Module Name</span> field in the <span>Basic                     settings</span> view and is intended to establish relationship with the                  lookup module specified in the <span>Module name</span> column in this                  table. You can enter built-in relationship fields and custom relationship fields.                  For information about how to define the lookup relationship fields and how to                  provide their correct names in the <span>Lookup relationship field                     name</span> field, go to the Salesforce website and launch the Salesforce                  Data Loader application for proper actions and information.</p> </li> <li> <p><span>Module                     name</span>: the name of the lookup module.</p> </li> <li> <p><span>External                     id name</span>: the name of the external ID field in the lookup module                  specified in the <span>Module name</span> column.</p> </li> </ul><br><br>This property is<br>available only when UPSERT is selected from the<br>Output Action drop-down list. |
| Extend Insert | This check box is selected by default and allows you to transfer the output<br>data in batches. In the Commit Level field<br>displayed, specify the number of lines per batch. |
| Die on Error | This check box is selected by default. Clear the check box to skip the row<br>on error and complete the process for error-free rows. If needed, you can retrieve<br>the rows on error via a Row &gt; Rejects link. |
| Retrieve Id | Select this check box to allow Salesforce to return the Salesforce ID for<br>the inserted or updated records.<br><br>This check box is available<br>only when INSERT or UPSERT is<br>selected from the Output Action<br>drop-down list and the Extend Insert<br>check box is cleared.<br><br>When this check box is selected and the<br>tSalesforceOutput component is linked to another<br>component via a Row &gt; Main connection, the following column(s) will be added to the schema<br>of the data flow:<br><br><ul> <li> <p> <span>salesforce_id</span>: the Salesforce ID of the created or                           updated record.</p> </li> <li> <p> <span>salesforce_upsert_status</span> (only for                              <kbd>UPSERT</kbd>): the status of the upsert action to                           indicate whether the record is created or updated.</p> </li> </ul> |
| Ignore Null | Select this check box to ignore NULL values.<br><br>This<br>property is available only when UPDATE or<br>UPSERT is selected from the Output Action drop-down list. |
| Log File Name | Specify the path to the log file that holds all error logs. |
| Use UTC time for datetime | Select this option to use the UTC time for datetime type data. If this<br>option is cleared, the local time is used. |
| tStatCatcher Statistics | Select this checkbox to gather the Job processing metadata at the Job level<br>as well as at each component level. |

## Global Variables

| Variables | Description |
| --- | --- |
| NB\_LINE | The number of rows processed. This is an After variable and<br>it returns an integer. |
| NB\_SUCCESS | The number of rows successfully processed. This is an After<br>variable and it returns an integer. |
| NB\_REJECT | The number of rows rejected. This is an After variable and<br>it returns an integer. |
| ERROR\_MESSAGE | The error message generated by the component when an error<br>occurs. This is an After variable and it returns a string. |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | This component can be used as an end<br>component or an intermediate component of a Job or subJob and it always needs an input<br>link. |
| Limitation | If you change the component schema or any of the following parameters — Output Action, Extend Insert, or Retrieve Id — click Guess Schema on Schema MAIN and Reject Schema to refresh the output schemas accordingly.<br><br>Information noteNote: This behavior will be improved in a future release to support automatic schema updates. |

**Related concepts**

* [Upserting Salesforce data based on external IDs](https://help.qlik.com/talend/en-US/components/8.0/salesforce/tsalesforceinput-tsalesforceconnection-tlogrow-upserting-salesforce-data-based-on-external-ids-standard-component-the-job "Here is an example of using Talend components to insert and update Salesforce Contact object data based on the mapping relationship with external IDs of the Account object.")