# Salesforce Upsert

## <img src="/files/RJuerxEQMe7LnHGykAsI" alt="" data-size="line"> Salesforce Upsert

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

The Salesforce Upsert transform updates existing records and inserts new records into your Salesforce database using the Salesforce Web Service.

You can also use the following other transforms to modify your Salesforce database:

* [Salesforce Input](/data-shaper-1.21/knowing-the-data-shaper-designer/pipelines/transforms/salesforceinput.md): Reads records directly from 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 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 Upsert transform on the canvas. You can customize the name or leave it as the default.

#### Connection

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

Enter the insert process settings in the following transform options:

| Option                  | Description                                                                                                                                                                                                                                                             |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Time out                | Specify the timeout interval in milliseconds before the transform times out.                                                                                                                                                                                            |
| Use compression         | Select to compress (.gzip) data when connecting between Hop and Salesforce.                                                                                                                                                                                             |
| Rollback all changes on | Revert changes unless all records are processed successfully. When you select this option, records without errors are inserted, while records with errors are marked as failed in the insertion results. The default behavior is to allow partial success of insertion. |
| Batch Size              | Indicate the maximum number of records to collect before the insert is committed.                                                                                                                                                                                       |
| Module                  | <p>Select the module (table) in which you want to insert records.<br>Note: This list will be populated upon successfully authenticating to Salesforce using the Test Connection button.</p>                                                                             |

| Upsert Comparison Field | Specify the Salesforce ID of the field to use as a basis of comparison to determine if you are updating an existing record or inserting a new record. |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |

#### Output Fields

Enter the output information in the following transform option:

Salesforce ID fieldname: Specifies the field to contain the Salesforce ID of the first record in the set of records (batch) you updated and inserted.

#### Fields

You can specify what fields to insert into your Salesforce database through the Fields table. Click Get fields to populate the table with input from the Hop data stream.

The table contains the following columns:

<table><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td>Module field</td><td>The name of the field within the Module</td></tr><tr><td>Stream field</td><td>The name of the field in the Hop data stream</td></tr><tr><td>Use External id?</td><td><p>The flag indicating if the field links to an external ID. To resolve the ID, Salesforce needs the object type, column name, and relationship name in the following syntax:<br></p><pre class="language-shell"><code class="lang-shell">Object name:column name/relationship
</code></pre></td></tr></tbody></table>

Optionally, click Edit mapping to specify custom mapping. For example, you can map a single Hop field to multiple Salesforce fields.


---

# 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/salesforceupsert.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.
