# Merge Field Rules

### Overview

While the General Settings define the default strategy for the entire record (e.g., "Keep the Oldest Record"), Merge Field Rules allow you to apply surgical precision to specific data points.

Why use this? Some examples...

* **Data Consistency**: Ensure that address fields (City, State, Zip) always move together so you don't end up with a "Frankenstein" record (e.g., City from Record A, Zip Code from Record B).
* **Data Selection**: Prioritize the record that has the *best* data for specific fields (e.g., "Always take the record with a LinkedIn URL").
* **Audit Trails**: Concatenate IDs from all merged records into a text field for tracking.

### Creating a New Rule

1. Access the Section: In Merge Settings, expand Merge Field Rules.
2. Add Rule: Click the + Add Rule button.
3. Define Strategy: You will select a Merge Strategy from the dropdown menu. The most common strategies are detailed below.

#### Strategy 1: Copy Multiple Fields (Group Sync)

[Use this strategy to keep related fields together.](/delpha-for-salesforce/how-to-faq/delpha-duplicate/what-is-field-grouping.md) The most common use case is for Addresses. If you select the "Billing City" from Record B, you want to automatically pull the "Billing State" and "Billing Zip" from Record B as well, regardless of who the Master Record is.

* Selection Field: Choose the "Anchor" field that determines the winner (e.g., `Billing City`).
* Selection Condition: Choose the logic (e.g., `Master and Not Empty`). This means Delpha looks at the Master; if the City is missing there, it looks at the duplicates.
* Fields Affected: Add all the related fields that must follow the anchor (e.g., `Billing Country`, `Billing Street`, `Billing Zip/Postal Code`).
  * *Result:* If Delpha picks the City from Record B, it forces all these other fields to also come from Record B.

{% hint style="info" %}
When the Merge Strategy is Copy Multiple Fields, 2 key fields must be defined:&#x20;

* The **Selection Field** determines the reference record based on the Selection Condition.&#x20;
* The **Display Field** is shown in the Merge Editor and appears above all affected fields marked as visible in the rule.
* **Use Selection Field as Display Label**: Use the same field for both selection and display in the merge editor.&#x20;
* **Shown/Hidden Toggle**: In the "Fields Affected" list, you can decide if these fields are visible to the user during a manual review or processed silently in the background.
  {% endhint %}

#### Strategy 2: Set One Field to a Fixed Value

Use this to force a specific value onto the final record, regardless of what exists in the source records.

* Use Case: Resetting a status or adding a "Merged" flag.
* Set a fixed value: Enter the specific text or value (e.g., `Verified`) that will be stamped onto the final record.

#### Strategy 3: Transform one field - [Audit trail](/delpha-for-salesforce/how-to-faq/delpha-duplicate/how-can-i-keep-both-values-of-a-field-after-the-merge.md)

* Select Strategy: In the Merge Strategy dropdown, select **Transform one field**.
* Configure Logic:
  * Input Field: Choose the source data to capture. For an ID audit trail, select Account ID (or Contact ID/Lead ID).
  * Operation to Perform: Select Concatenate and Unicity.
    * *Concatenate:* Joins the values together with a separator (e.g., `ID_A; ID_B; ID_C`).
    * *Unicity:* Ensures the same ID isn't listed twice.
  * Output Field: Select the custom text field on your record where this list will be stored (e.g., `DDQ_Merge_Ids__c`).

#### Other Transformation Operations

The "Transform one field" strategy supports various mathematical operations for numeric fields. You can use this to sum up totals from duplicates instead of losing them.

* Add: Sums the values from all records. (e.g., *Total Lifetime Value* = Record A Revenue + Record B Revenue).
* Subtract: Subtracts values (Master is minuend).
* Multiply: Multiplies values together.
* Divide: Divides values (Master is dividend).
* Concatenate: Joins text strings (without removing duplicates).

{% hint style="info" %}
The Transform one field option a**utomatically hides** the field from the merge editor.[ You can use it to prevent a field to be manually modified at merging. ](/delpha-for-salesforce/how-to-faq/delpha-duplicate/how-can-i-hide-a-field-from-the-delpha-bot-conversation.md)
{% endhint %}

***


---

# 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/use-cases-setup/duplicate/duplicate-merge/merge-field-rules.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.
