# Salesforce Input

## ![](/files/rgDEjH1ZyMIFNGA0mhwN) Salesforce Input

### Description <a href="#description" id="description"></a>

The Salesforce Input transform reads data directly from Salesforce using the Salesforce Web Service.

You can also use the following transforms for various ways to modify your Salesforce database:

* [Salesforce Insert](/data-shaper-1.21/knowing-the-data-shaper-designer/pipelines/transforms/salesforceinsert.md): Inserts records directly into your Salesforce database
* [Salesforce Update](/data-shaper-1.21/knowing-the-data-shaper-designer/pipelines/transforms/salesforceupdate.md): Updates records directly into your Salesforce database.
* [Salesforce Upsert](/data-shaper-1.21/knowing-the-data-shaper-designer/pipelines/transforms/salesforceupsert.md): Updates existing records and inserts new records into your Salesforce database.
* [Salesforce Delete](/data-shaper-1.21/knowing-the-data-shaper-designer/pipelines/transforms/salesforcedelete.md): Deletes records directly from your Salesforce database.

| Hop Engine | <sup>✓</sup> |
| ---------- | ------------ |
| Spark      | ?            |
| Flink      | ?            |
| Dataflow   | ?            |

### General

Enter the following information in the transform name field:

* Transform name: Specifies the unique name of the Salesforce Input transform on the canvas. You can customize the name or leave it as the default.

{% hint style="info" %}
Note: If your organization has enabled My Domain, you may see 'Restricted Domain' in your Salesforce login history when attempting to use the default URL, as described [here](https://help.salesforce.com/s/articleView?id=000387792\&type=1). See below for options.
{% endhint %}

### Options

#### Connection <a href="#connection" id="connection"></a>

Enter the connection information in the following transform options:

| Salesforce Webservice URL | <p>Specify the URL to the Salesforce Webservice.</p><p>Default: <a href="https://login.salesforce.com/services/Soap/u/50.0"><https://login.salesforce.com/services/Soap/u/50.0></a></p><p>You may need to update this if your company uses "My Domain" on salesforce. If so, check with your Salesforce Administrator for the URL. Generally of the format <a href="https://name.my.salesforce.com/services/Soap/u/50.0"><https://NAME.my.salesforce.com/services/Soap/u/50.0></a>. You can access a sandbox by using its URL here as well. It is strongly recommended to utilize <a href="/pages/MDVdVK0d5hzHVfaMxTBG">variables</a> to populate these values.</p> |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Username                  | Specify the username for authenticating to Salesforce                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Password                  | Specify the password for authenticating to Salesforce. Enter your password followed by your security token. For example, if your password is PASSWORD and your security token is TOKEN, you would enter PASSWORDTOKEN in this field.                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Test Connection           | Click to verify the connection can be made to the Salesforce Webservice URL you specified.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

### Settings

In this panel, you can set the module to query from as well as the query conditions.

| Option          | Description                                                                                                                                                                                                  |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Specify query   | Select this check box to manually execute a query based on your own SOQL statements.                                                                                                                         |
| Module          | <p>Select the module (table) from which you want to retrieve data.<br>Note: This list will be populated upon successfully authenticating to Salesforce using the Test Connection button.</p>                 |
| Query Condition | <p>Enter any query filters you want to apply. Variables are allowed. For example, 'fieldname=myvalue AND fieldname2=myvalue2'.</p><p>Note: You do not need to include WHERE in your condition statement.</p> |

### Content Tab

The content tab allows you to optionally include additional descriptive fields in the result set.

#### Advanced

Use these options to further refine the data returned from the queries specified in the Settings tab. For example, you may want to only query deleted records within a specified date range. The Advanced panel includes the following fields:

| Option            | Description                                                                                                                                                 |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Retrieve          | Select which records you want to retrieve to further define your pool of data. You can select All, Updated, or Deleted.                                     |
| Query all records | Select the check box to query all the records you are retrieving. Clear the check box to use the date fields (below) to define a range of records to query. |
| Start date        | Specify the starting date for retrieving the records in the date range. The format is 'yyyy-MM-dd HH:mm:ss'.                                                |
| End date          | Specify the end date for retrieving the records in the date range. The format is 'yyyy-MM-dd HH:mm:ss'.                                                     |

#### Additional Fields

This panel includes the following fields:

| Option                                                     | Description                                                                                                                                                                                     |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Include URL in output? & URL fieldname                     | Select this check box, then enter the URL used to retrieve the data.                                                                                                                            |
| Include Module in output? & Module fieldname               | Select this check box, then enter the name of the module from which the data was retrieved.                                                                                                     |
| Include SQL in output? & SQL fieldname                     | Select this check box, then enter the SQL used to generate the result set.                                                                                                                      |
| Include timestamp in output? & Timestamp fieldname         | Select this check box, then enter the timestamp for when the record was retrieved.                                                                                                              |
| Include Rownum in output? & Rownum fieldname               | Select this check box, then enter the row number for each record retrieved.                                                                                                                     |
| Include deletion date in output? & Deletion date fieldname | <p>Select this check box, then enter the deletion date for when the record was removed.<br>Note: This set of fields is only enabled when the Advanced> Retrieve option is set to ‘Deleted’.</p> |

#### Other fields

Enter information for the remaining fields on the Content tab.

| Option          | Description                                                                                                                                                          |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Time out        | Specify the timeout interval in milliseconds before the transform times out.                                                                                         |
| Use compression | Select to compress (.gzip) the data when connecting between Hop and Salesforce.                                                                                      |
| Limit           | <p>Specify the maximum number of records to retrieve.<br>Note: When you set the limit to '0', there is no limit on the number of records that can be retrieved, </p> |

### Fields tab

The fields tab displays the fields that are read from the Salesforce module selected on the Settings tab. You will need to go to the Fields tab and press the Get Fields button to populate the fields returned before you can preview the rows returned.

The following are the properties display in the Fields tab:

| Option      | Description                                                                                                                                                                                                                                                                          |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Name        | The name of the input field.                                                                                                                                                                                                                                                         |
| Field       | The name of the field that contains the record.                                                                                                                                                                                                                                      |
| IsIdLookup? | Specify if the field will be used as a fieldname ID (links to an External ID) when accessing the database to perform other calls, such as delete, insert, update, and upsert. Select ‘Y’(es) or ‘N’(o).                                                                              |
| Type        | The data type of the field.                                                                                                                                                                                                                                                          |
| Format      | An optional mask for converting the format of the original field.                                                                                                                                                                                                                    |
| Length      | <p>The length of the field depends on the following field types:</p><ul><li>Number: Total number of significant figures in a number</li><li>String: Total length of string</li><li>Date: Length of printed output of the string (for example, four is a length for a year)</li></ul> |
| Precision   | Number of floating point digits for number-type fields.                                                                                                                                                                                                                              |
| Currency    | Symbol used to represent currencies ($5,000.00 or €5.000,00 for example).                                                                                                                                                                                                            |
| Decimal     | A decimal point can be a "." or "," (5,000.00 or 5.000,00 for example).                                                                                                                                                                                                              |
| Group       | A grouping can be a "," or "." (5,000.00 or 5.000,00 for example).                                                                                                                                                                                                                   |
| Trim type   | The trimming method to apply to a string. Trimming only works when no field length is specified.                                                                                                                                                                                     |
| Repeat      | If the corresponding value in this row is empty, repeat the one from the last time it was not empty. Select ‘Y’(es) or ‘N’(o).                                                                                                                                                       |

Salesforce Input

#### Example Case: Retrieving Deleted Records from Salesforce

**Scenario**

You want to retrieve all deleted records from Salesforce, even when the dataset exceeds the default pagination size of 2000 records.

**Steps**

1. **Set "Retrieve" to "Deleted"**: In the **Advanced** section of the transform, select the "Retrieve" option and set it to **Deleted**.
2. **Enable "Query all records"**:
   * Check the box labeled **Query all records** in the **Advanced** section.
   * This allows the transform to retrieve all available records across multiple pages.
3. **Add a Query Condition**:
   * In the **Settings** tab, include the following query condition: `IsDeleted = true`
   * This ensures the transform retrieves only deleted records.

**Note on Pagination**

If "Query all records" is not enabled, the transform will retrieve only the first 2000 records due to Salesforce’s default pagination settings. Enabling "Query all records" ensures that the system processes all pages of data until all matching records are retrieved.

**Example Use Case**

You want to retrieve all customer records deleted within the past 30 days. Configure your transform as follows:

* Retrieve: Set to `Deleted`.
* Query Condition: `IsDeleted = true AND LastModifiedDate >= LAST_N_DAYS:30`

**Troubleshooting**

* If the transform retrieves fewer records than expected, verify that **Query all records** is enabled.
* Ensure your Salesforce user has appropriate permissions to access deleted records.


---

# 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.primeur.com/data-shaper-1.21/knowing-the-data-shaper-designer/pipelines/transforms/salesforceinput.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.
