# How can I keep both values of a field after the merge

## How to Keep Track of Candidate Record Values During a Merge

When merging duplicate records in Salesforce using Delpha, the **Master record is retained** while the **Candidate record is deleted**. Standard merge logic retains only selected field values based on your Merge Field Rules.

However, in some cases, you may want to **retain and track values from the Candidate record** — such as legacy IDs, previous emails, or alternate names — for audit, traceability, or post-merge processing.

Delpha allows this via the **“Concatenate and Unicity” operation**.

## Step-by-Step: Set Up a Merge Rule to Preserve Candidate Values

1. Open the **Delpha Setup** app.
2. Go to the **Duplicate Settings** tab.
3. Select the target **object** (e.g., Account, Contact).
4. Scroll to the **Merge Field Rules** section.
5. Click **New Rule**.

Then configure the following:

| Field            | Description                                                                                |
| ---------------- | ------------------------------------------------------------------------------------------ |
| **Action**       | Select `Operation`                                                                         |
| **Input Field**  | Choose the field whose values (from both records) you want to track (e.g., `Legacy_Id__c`) |
| **Output Field** | A custom field (usually text or long text) where the unique values will be stored          |
| **Operation**    | Select `Concatenate and Unicity`                                                           |

This operation:

* Collects values from **both the Master and Candidate**
* **Deduplicates them**
* Combines them into the **Output Field**

## Use Case: Tracking Legacy IDs

If you store legacy system IDs in a custom field (e.g., `Legacy_Id__c`), you can use this rule to **keep all IDs** from merged records:

This ensures historical traceability and can be used in **post-merge automation or reporting**.

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><p><strong>Master</strong><br>Legacy Id: <mark style="color:green;">FJQn</mark></p><p>Merged Legacy Ids : &#x3C;Empty></p></td><td valign="top"><p><strong>Candidate</strong></p><p>Legacy Id: <mark style="color:red;">rAAH</mark></p><p>Merged Legacy Ids: <mark style="color:orange;">oYAAX</mark></p></td><td valign="top"><p><strong>Master and Not Empty + Concatenate and Unicity</strong></p><p>Legacy Id: <mark style="color:green;">FJQn</mark></p><p>Merged Legacy Ids: <mark style="color:orange;">oYAAX</mark>, <mark style="color:red;">rAAH</mark></p></td></tr></tbody></table>

## Result

After merging:

* The **Output Field** contains all unique values from both records
* You preserve key information from deleted candidates
* Your data governance and traceability stay intact


---

# 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://help.delpha.io/delpha-for-salesforce/how-to-faq/delpha-duplicate/how-can-i-keep-both-values-of-a-field-after-the-merge.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.
