# Upserting Salesforce Data

**Upsert** is a combination of Updating and Inserting. If a record in a file matches an existing record, the existing record is updated with the values in your file. The record is created as a new entity if no match is found.

Step-By-Step Guide:

1. **Create Upsert Job**
   * From the **DataLoader – Basic** page, select **Create new job**.
   * Choose **Upsert** as the operation type.

     <figure><img src="/files/pgPJS0efsYN9ono0TMMN" alt=""><figcaption></figcaption></figure>
2. #### Choose Sandbox
   * In the **Create upsert process** window, select a **Salesforce Org**.
   * Provide details such as **Environment, Login URL, and Username**.

     <figure><img src="/files/Zo64lRrDzEQZnR2lLSta" alt=""><figcaption></figcaption></figure>
3. #### Fetch Objects
   * After entering the sandbox details, click **Login and Fetch Objects**.
   * This retrieves the list of objects available for the upsert operation.

     <figure><img src="/files/CjDYKg73fuLghMTzyROj" alt=""><figcaption></figcaption></figure>
4. #### Select Object&#x20;
   * From the fetched list, choose the required object (e.g., **Contact**).
   * Click **Next** to proceed with field mapping.

     <figure><img src="/files/s4eQuNZ6n0gGW3UO2Z7b" alt=""><figcaption></figcaption></figure>
5. **Upload File for Upsert**
   * In the **Create upsert process** screen, select **Choose File** or drag and drop to upload a CSV file.

     <figure><img src="/files/I0gdZVYM6DAKw9aQ1oxb" alt=""><figcaption></figcaption></figure>
   * The file will be used for field mapping against Salesforce objects.
6. #### Upload in Progress
   * The uploaded CSV file appears with a **Pending** status.

     <figure><img src="/files/yLOHAiQc2eLo0CSe81JH" alt=""><figcaption></figcaption></figure>
   * Additional files can be uploaded or existing ones removed, if required.
7. #### Upload Completed
   * Once processed, the file shows a **Completed** status.

     <figure><img src="/files/sqgns75fSHD4dyeQeORR" alt=""><figcaption></figcaption></figure>
   * A confirmation message indicates the number of impacted records.
8. #### Field Mapping with AutoMap
   * Uploaded file fields appear under **Source header** with sample data.

     <figure><img src="/files/DRkr2VF64ITkh9rzRBMB" alt=""><figcaption></figcaption></figure>
   * Enable **AutoMap** to automatically align fields with Salesforce.
   * Manually select fields if AutoMap does not resolve all mappings.
9. #### Field Mapping Filters
   * Use the filter option to view **All**, **Mapped**, or **Unmapped** fields.

     <figure><img src="/files/csZqkjdFDAUmUW9Ja0tc" alt=""><figcaption></figcaption></figure>
   * This helps quickly validate field mappings before proceeding.
10. **Lookup Mapping Initiation**
    * In **Fields Mapping**, select **Lookup via** for fields such as `AccountId`.

      <figure><img src="/files/nzHHaUxFEfOX95ziJKnK" alt=""><figcaption></figcaption></figure>
    * This enables referencing related Salesforce records using specific field values.
11. **Configure Lookup Options**
    * After enabling **Lookup via**, select the Salesforce object and field to be used for matching records (e.g., Account → LastName).

      <figure><img src="/files/cSsl7W5EuQb3p1advvT0" alt=""><figcaption></figcaption></figure>
    * Additional conditions can be set:
      * **Use first match if multiple results** – prioritizes the first match when more than one record is found.
      * **Insert if not found** – creates a new record if no matching record exists.
    * These options provide flexibility in handling relationships and data consistency during the upsert process.
12. #### Select Lookup Field
    * A dropdown displays available Salesforce fields for the selected object.

      <figure><img src="/files/uA7CoaAhlwbGxCOdXQjX" alt=""><figcaption></figcaption></figure>
    * Pick the desired field (e.g., `LastName`, `FirstName`) to complete the lookup mapping.
13. #### Completed Lookup Mapping
    * The field is now mapped with **Lookup via** enabled.

      <figure><img src="/files/laenwEDgY7zyj7FdwQMz" alt=""><figcaption></figcaption></figure>
    * The selected Salesforce field is shown, along with the applied lookup conditions.
14. **Schedule Configuration – No Schedule**
    * In the **Schedule** step, select **No Schedule** to run the upsert job manually.

      <figure><img src="/files/Nf4V7AbjlGlx8b9nWLIq" alt=""><figcaption></figcaption></figure>
    * The job will only execute when triggered directly.
15. #### Schedule Configuration – Daily
    * Select **Daily** to schedule the job for execution every day.

      <figure><img src="/files/dQ8RO3s8KwhStHsCAkOP" alt=""><figcaption></figcaption></figure>
    * Configure the **start date** and choose to run at a **specific time** or at a **fixed interval**.
    * Set the **end condition**: Never, a fixed number of occurrences, or a specific end date.
16. #### Schedule Configuration – Weekly
    * Select **Weekly** to schedule the job on specific days of the week.

      <figure><img src="/files/QOUqT2FnTlDVbcGhemwC" alt=""><figcaption></figcaption></figure>
    * Configure the **start date** and define the execution time.
    * Set the **end condition** similar to daily scheduling.
17. **Process Details**
    * Review the object, type of operation, and number of records to be processed.

      <figure><img src="/files/3sddW7Rnb0Aaho0f9gAH" alt=""><figcaption></figcaption></figure>
    * Confirm the Salesforce connection and enter a process name
    * Optionally, assign the process to a **Job Group** for better organization.
18. **Run Job**
    * From the Dataloader **Basic** page, select the **Run** (play) icon under **Actions** for the required job.
    * The **Run Configuration** window opens to adjust run options before execution.

      <figure><img src="/files/vWvcQtdr3PMdYmbYj5aB" alt=""><figcaption></figcaption></figure>
    * Click **Run** to start the job or **Cancel** to exit without running.
19. **Run Configuration**

    * The **Run Configuration** window allows toggling options such as:

      * **Disable workflow rules**
      * **Disable validation rules**
      * **Insert/update with null values**
      * **Use UTF-8 encoding for file operations**

      <figure><img src="/files/mKDIzp48zAZjcL3sUNRY" alt=""><figcaption></figcaption></figure>
    * Optionally, choose a different data CSV file if required.
    * Confirm with **Run** to execute the job.
    * Dataloader Configuration Options

    | Configuration                      | Description                                                                      |
    | ---------------------------------- | -------------------------------------------------------------------------------- |
    | **Batch Size**                     | Applies if Bulk API is disabled. Based on SOAP and better for smaller datasets.  |
    | **Disable workflow rules**         | Deactivates workflows during operation and reactivates post-process.             |
    | **Disable Validation Rules**       | Deactivates validation rules during the process and re-enables afterward.        |
    | **Insert/Update with null values** | Allows null value updates in destination org.                                    |
    | **Use UTF-8 file encoding**        | Required for data containing English alphabets. Disable for non-English content. |
20. **Upload New Data File**
    * Select **Choose Different Data CSV File** to upload an alternate dataset.
    * The file upload section allows drag-and-drop or file selection.

      <figure><img src="/files/LRWSGiZi8IzGyU8JLNIF" alt=""><figcaption></figcaption></figure>
    * Upon successful upload, a confirmation message displays the number of records impacted.
21. **Job In Progress**
    * After execution begins, the job status updates to **In Progress** on the Dataloader Basic page.

      <figure><img src="/files/LTuVlSCbPFpZHI1uMWzY" alt=""><figcaption></figcaption></figure>
    * This indicates that processing has started but is not yet complete.
22. **Abort Job**
    * While a job is **In Progress**, select the **Abort** button under **Actions**.

      <figure><img src="/files/Gm31x67JkTkEkHFOQnJK" alt=""><figcaption></figcaption></figure>
    * This immediately halts the job execution.
    * Aborting should only be used if the run was triggered incorrectly or requires stopping due to issues.
23. **Edit Configuration**
    * From the Dataloader Basic page, select the ellipsis (three dots) next to the desired job.

      <figure><img src="/files/qz9l3Kp7s8cMxCHfZ4sy" alt=""><figcaption></figcaption></figure>
    * Choose **Edit** to modify the existing configuration.
    * Update object selections, field mappings, or process details as required.
24. **Edit Process – Select Object**
    * In the Edit upsert process page, log in to the Salesforce Org and fetch available objects.

      <figure><img src="/files/q3K0Lt4QX4vCdpcqc0Cx" alt=""><figcaption></figcaption></figure>
    * Select the object to be used for the process.
    * Proceed to update field mappings or schedule settings.
25. **Schedule Configuration (Screen 35)**
    * From the Dataloader Basic page, select the ellipsis (three dots) next to a job.

      <figure><img src="/files/aRi59JqAiw2YWicqhMYZ" alt=""><figcaption></figcaption></figure>
    * Choose **Schedule** to define when the process should run automatically.
26. **Schedule Process (Screen 36)**
    * In the scheduling window, select the preferred type: **No Schedule, Daily, or Weekly**.

      <figure><img src="/files/M2YBI8UGYq3FNLhhya02" alt=""><figcaption></figcaption></figure>
    * Confirm the schedule by clicking **Schedule**.
27. **Delete Configuration (Screen 37)**
    * From the Dataloader Basic page, select the ellipsis (three dots) for a specific job.
    * Choose **Delete** to remove the selected configuration permanently.

      <figure><img src="/files/4TbCOArjE9gPTTYWquKa" alt=""><figcaption></figcaption></figure>
    * This action cannot be undone and should only be used when the process is no longer required.
28. **Delete Process Confirmation (Screen 38)**
    * A confirmation dialog appears before deleting the process.

      <figure><img src="/files/MrsZ3TbG4XI2SAQ4GUOV" alt=""><figcaption></figcaption></figure>
    * Click **Delete** to proceed or **Cancel** to stop the action.
29. **Clone Configuration (Screen 39)**
    * From the Dataloader Basic page, select the ellipsis (three dots) next to the desired job.
    * Choose **Clone** to duplicate the selected configuration.

      <figure><img src="/files/MezpqCI6FafQv2lxNfQv" alt=""><figcaption></figcaption></figure>
    * Review the process details and optionally choose a different data CSV file.
    * Click **Clone** to create the duplicate job.
30. **Clone Process (Screen 40)**
    * The Clone window displays process details including operation type, object name, and source sandbox.

      <figure><img src="/files/tJm2kHEbopdfsjOfWpee" alt=""><figcaption></figcaption></figure>
    * Enter or update the process name if needed.
    * Select an alternate data CSV file if applicable.
    * Confirm the duplication by clicking **Clone**.
31. **Validation / Workflow Rules Access**
    * From the **Dataloader Basic** page, select the **Validation Rules / Workflow Rules** icon under the *VR/WFR* column for a specific job.

      <figure><img src="/files/hF8X4B3SyIMF08yjBCXF" alt=""><figcaption></figcaption></figure>
    * This opens a detailed view of validation and workflow rules configured for the selected Salesforce object.
    * Use this option to verify if any rules may impact the execution of the job.
32. **Validation Rules**
    * The **Validation Rules** tab lists all validation rules for the selected object.

      <figure><img src="/files/prrV6tsDYJV7ae5TCgpd" alt=""><figcaption></figcaption></figure>
    * Each rule displays its *name, previous state, current state, enable status,* and any associated *errors*.
    * This view ensures data consistency by confirming whether validation rules are active or disabled during job execution.
33. **Workflow Rules**
    * The **Workflow Rules** tab provides details of all workflow rules for the selected object.

      <figure><img src="/files/0YXkeNM5N2MA33Z8Dxff" alt=""><figcaption></figcaption></figure>
    * Each workflow rule displays its *name, previous state, current state,* and *enable status*.
    * Reviewing these rules allows proper alignment with business automation before running or scheduling jobs.
34. **View Job Results**
    * From the **Dataloader Basic** page, select the **magnifying glass icon** under *Results of Last Run* for the required job.

      <figure><img src="/files/DeQC0olLFqtmnCaoXnpT" alt=""><figcaption></figcaption></figure>
    * This opens the results view for the most recent execution.
    * Use this option to quickly validate both success and failure counts before downloading detailed logs.
35. **CSV Result View**
    * The **CSV Result** window displays record-level details from the last job execution.

      <figure><img src="/files/Lh0xw9VWlozb5gAcRI7I" alt=""><figcaption></figcaption></figure>
    * Each row shows Salesforce fields such as *ID, AccountId, FirstName, LastName,* and other mapped fields.
    * This view helps confirm which records were processed successfully and identify any errors or mismatches.
36. **View Failed Records**
    * From the **Dataloader Basic** page, select the **magnifying glass icon** under the *Failure* column for the required job.

      <figure><img src="/files/QYm4bDCNaFa3myO0EWxx" alt=""><figcaption></figcaption></figure>
    * This opens the result view specifically for failed records in the last run.
    * Use it to investigate why certain records failed while others succeeded.
37. **CSV Failed Records**
    * The **CSV Result** window displays detailed information for failed records.

      <figure><img src="/files/NyTwsjSQmhSouv5MCuAM" alt=""><figcaption></figcaption></figure>
    * Fields such as *Id, AccountId, LastName, FirstName,* and others are shown with their corresponding values.
    * This view helps identify the root cause of failures by examining data values and constraints against validation or workflow rules.


---

# 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://knowledgebase.autorabit.com/product-guides/arm-1/arm-features/dataloader/single-dataloader/upsert-salesforce-data.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.
