# Salesforce Input

The Salesforce Input step reads data from Salesforce using the Salesforce web service.

### See also

* [Salesforce Insert](/pdia-data-integration/pdi-transformation-steps-reference-overview/salesforce-insert.md)
* [Salesforce Update](/pdia-data-integration/pdi-transformation-steps-reference-overview/salesforce-update.md)
* [Salesforce Upsert](/pdia-data-integration/pdi-transformation-steps-reference-overview/salesforce-upsert.md)
* [Salesforce Delete](/pdia-data-integration/pdi-transformation-steps-reference-overview/salesforce-delete.md)

### General

* **Step name**: Specify the unique name of the Salesforce Input step on the canvas. You can customize the name or leave it as the default.

### Settings tab

Use the **Settings** tab to configure the connection and query settings.

#### Connection

| Option                        | Description                                                                                                                                       |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Salesforce webservice URL** | URL of the Salesforce web service. The URL depends on the Salesforce API version used by PDI. Salesforce API versions 47.0 to 60.0 are supported. |
| **Username**                  | User name for authenticating to Salesforce (for example, `myname@company.com`).                                                                   |
| **Password**                  | Password followed by your security token. For example, if password is `password` and token is `token`, enter `passwordtoken`.                     |
| **Test connection**           | Verifies that the connection can be made to the configured Salesforce webservice URL.                                                             |

#### Query

| Option              | Description                                                                                                                        |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **Specify query**   | Select to run a custom query using SOQL.                                                                                           |
| **Module**          | Salesforce module/object to query (default is `Account`). This list is populated after a successful **Test connection**.           |
| **Query condition** | Query filter expression. Variables are allowed. Do not include `WHERE` (for example, `fieldname=myvalue AND fieldname2=myvalue2`). |

### Content tab

Use the **Content** tab to include optional descriptive fields in the output and to set request behavior.

#### Output metadata fields

| Option                                                         | Description                                                                                                                |
| -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| **Include URL in output? / URL fieldname**                     | Adds the URL used to retrieve the data.                                                                                    |
| **Include module in output? / Module fieldname**               | Adds the module/object name used for the query.                                                                            |
| **Include SQL in output? / SQL fieldname**                     | Adds the query text used to generate the result set.                                                                       |
| **Include timestamp in output? / Timestamp fieldname**         | Adds the timestamp when the record was retrieved.                                                                          |
| **Include rownum in output? / Rownum fieldname**               | Adds a row number to each output record.                                                                                   |
| **Include deletion date in output? / Deletion date fieldname** | Adds the date when the record was removed. This option is enabled only when **Advanced > Retrieve** is set to **Deleted**. |

#### Request options

| Option              | Description                                                       |
| ------------------- | ----------------------------------------------------------------- |
| **Time out**        | Timeout in milliseconds. Default is `60000`.                      |
| **Use compression** | Select to use `.gzip` compression between PDI and Salesforce.     |
| **Limit**           | Maximum number of records to retrieve. Default is `0` (no limit). |

### Fields tab

Use the **Fields** tab to define which fields to read from the selected module.

Select **Get fields** to populate the list of returned fields before previewing rows.

| Option          | Description                                                                                                                        |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **Name**        | Output field name.                                                                                                                 |
| **Field**       | Salesforce field name.                                                                                                             |
| **IsIdLookup?** | Select whether the field is used as an ID lookup (links to an external ID) when used by other Salesforce steps. Set to `Y` or `N`. |
| **Type**        | Data type.                                                                                                                         |
| **Format**      | Optional mask for converting the original value format.                                                                            |
| **Length**      | Field length.                                                                                                                      |

* **Number**: Total number of significant digits.
* **String**: Total length of the string.
* **Date**: Length of printed output (for example, 4 for a year). | | **Precision** | Number of floating point digits for number fields. | | **Currency** | Currency symbol (for example, `$` or `€`). | | **Decimal** | Decimal point character (`.` or `,`). | | **Group** | Thousands separator character (`.` or `,`). | | **Trim type** | Trimming method for strings. Trimming works only when **Length** is not specified. | | **Repeat** | If the incoming value is empty, repeats the last non-empty value. Set to `Y` or `N`. |

For more information, see [Understanding PDI data types and field metadata](/pdia-data-integration/understanding-pdi-data-types-and-field-metadata.md).

### Metadata injection support

All fields of this step support metadata injection. You can use this step with [ETL metadata injection](/pdia-data-integration/pdi-transformation-steps-reference-overview/etl-metadata-injection.md) to pass metadata to your transformation at runtime.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pentaho.com/pdia-data-integration/pdi-transformation-steps-reference-overview/salesforce-input.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
