# tSalesforceInput

Retrieves data from a Salesforce object based on a query.

Information noteNote:

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

## 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

| 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>In this component the schema is related<br>to the Module selected.<br><br>To retrieve a column from a linked module<br>it is necessary to define the column in a particular manner in the<br>Edit schema<br>view, otherwise the relationship query will not work. The correct syntax<br>is: NameofCurrentModule\_Nameof-<br><br><br>LinkedModule\_NameofColumnofInterest.<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. |
| Query Mode | Select the query mode from the drop-down<br>list: Query,<br>Bulk, or<br>BulkV2.<br><br><ul> <li> <p> <span>Query</span>: the ordinary query.</p> </li> <li> <p> <span>Bulk</span>: the bulk query used to                                    query large data sets efficiently and reduce the number of API                                    requests.</p> </li> <li> <span>BulkV2</span>: the                                bulk query used to query even larger amount of data. Click <a href="https://developer.salesforce.com/docs/atlas.en-us.api_bulk_v2.meta/api_bulk_v2/introduction_bulk_api_2.htm" target="_blank">BULK API 2.0</a> for                                related information.</li> </ul> |
| Condition | Enter the query used to select the data<br>to be extracted between double quotation marks, for example, *"name='Talend'"* or *"name like '%talend\_user%'"*.<br><br>This<br>property is not available when the Manual Query<br>check box is selected. |
| Manual Query | Select this check box and in the<br>Full SOQL query<br>string field displayed, enter the full SOQL (Salesforce<br>Object Query Language) statement used to select the data to be retrieved<br>between double quotation marks. For more information about the SOQL, see<br>[Salesforce Object<br>Query Language (SOQL)](https://developer.salesforce.com/docs/atlas.en-us.200.0.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm). |
| Guess schema | Click this button to generate the schema columns based on<br>the query specified in the Full SOQL query<br>string field. If you are using a network proxy, this<br>function works with a SOCKS proxy only. You can create a SOCKS proxy by<br>selecting the Use Proxy option<br>and providing the related parameters in the Advanced settings view.<br><br>This<br>property is available only when the Manual Query<br>check box is selected.<br><br>Note that there are some limitations you<br>should be aware of when using this feature. Refer to the Known Limitations section in<br>Release Notes for more detailed information. |
| Guess query | Click this button to generate the query in the Full SOQL query string field based on<br>the defined module and schema.<br><br>For more information about how to set the module and<br>schema correctly when generating the SOQL queries, see [How to set schema for the guess query feature of tSalesforceInput](https://help.qlik.com/talend/en-US/components/8.0/salesforce/how-to-set-schema-for-guess-query-feature-of-tsalesforceinput).<br><br>This<br>property is available only when the Manual Query<br>check box is selected.<br><br>Note that there are some limitations you<br>should be aware of when using this feature. Refer to the Known Limitations section in<br>Release Notes for more detailed information. |
| Include deleted records | Select this check box to query all the<br>records, including the deleted ones. |

## 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. |
| Trace HTTP message | Select this check box to output the HTTP<br>interactions on the console.<br><br>This option is available<br>only when Bulk is selected from the Query Mode drop-down list. |
| Use HTTP Chunked | Select this check box to use the HTTP<br>chunked data transfer mechanism.<br><br>This property is<br>available only when Query is selected from the<br>Query Mode drop-down list. |
| 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. |
| Batch Size | Enter the number of registrations in each<br>processed batch.<br><br>This property is<br>available only when Query is selected from the<br>Query Mode drop-down list. |
| Normalize Delimiter | Enter the characters, strings, or regular expressions used to<br>normalize the data that is collected by queries set on different hierarchical<br>Salesforce objects.<br><br>This property is<br>available only when Query is selected from the<br>Query Mode drop-down list. |
| Column Name Delimiter | Enter the characters, strings, or regular expressions used to<br>separate the name of the parent object from the name of the child object when<br>you use a query on the hierarchical relations among the different Salesforce<br>objects.<br><br>Select column name delimiter carefully to avoid conflicts between the<br>resulting column names. For example, if a parent Salesforce object named<br>*Case* has two columns *Region\_c* and<br>*Case\_Region\_c*, and the character *\_* is used<br>as the column name delimiter, the query will fail to retrieve data from<br>the *Case\_Region\_c* column. This is because<br>*Case\_Region\_c* identifies the *Region\_c*<br>column in this case.<br><br>This property is<br>available only when Query is selected from the<br>Query Mode drop-down list. |
| Safety<br>Switch | Clear this check box if the length of any column of the<br>module to be queried is longer than 100,000 characters. By default, this<br>check box is selected to prevent excessive memory usage.<br><br>This property is available when Bulk or BulkV2 is selected from the Query Mode drop-down list. |
| All return null if value is<br>empty | Select this option to return null for empty values.<br><br>This property is available when Bulk or BulkV2 is selected from the Query Mode drop-down list. |
| Complete Job<br>timeout | The timeout value, in seconds, within which your bulk<br>query Job must be completed. By default, the value is set to 0, which means there is no time limit<br>for your Job to complete.<br><br>Salesforce has its own limit for bulk query. If it takes<br>time longer than Salesforce's timeout limit to process a batch, the<br>batch will be placed in a queue and processed later, and thus it might<br>take too much time for the Job to execute. In this case, you can define<br>the Complete Job timeout value to make your Job end in advance. For more<br>information about Salesforce's own limit, see [Bulk API Limits - Batch processing<br>time](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_concepts_limits.htm).<br><br>This property is available when Bulk or BulkV2 is selected from the Query Mode drop-down list. |
| Split query results into<br>small sets | Select this option to split the query results into data sets. You can set the<br>maximum number of records a dataset can hold in the Maximum number<br>of records per set field.<br><br>This option is available when you select BulkV2 from the Query Mode drop-down list in the<br>Basic settings view. |
| Enable PK<br>Chunking | Select this check box to enable PK (Primary Key, i.e., the object’s record ID)<br>chunking when extracting large amounts of records or when the query<br>consistently times out.<br><br><ul> <li> <p>In the <span>Chunk size</span> field displayed, specify the                           number of records within the ID boundaries for each chunk.</p> </li> <li> <p>Select the <span>Specify the parent object</span> check box to                           determine chunk boundaries using parent object record IDs. Enter the name                           of the parent object in the <span>Parent object</span>                           field.</p> <p>In a case where an object is supported, PK chunking can be used to query                           the object's sharing table. Specifying the parent object defines the                           chunk boundaries, which makes the query more efficient. </p> </li> <li> <p>In the <span>Salesforce API call delay</span> field displayed,                           specify the time (in seconds) between two Salesforce API calls while each                           batch is being processed.</p> </li> </ul><br><br>For more information, see [Use PK Chunking to Extract Large Data Sets from<br>Salesforce](https://developer.salesforce.com/blogs/engineering/2015/03/use-pk-chunking-extract-large-data-sets-salesforce.html).<br><br>This option is available<br>only when Bulk is selected from the Query Mode drop-down list. |
| Use UTC time for datetime | Select this option to use the UTC time for datetime type data. If this option is cleared, the<br>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. |
| 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<br>rule** | This component is usually used as a start component of a Job or<br>subJob and it always needs an output link. |

**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.")