# What is field grouping?

## How to Ensure Field Consistency During Record Merges in Delpha

When merging duplicate records, you may want to ensure that **multiple fields are consistently taken from the same source record**—especially for data like **addresses**, which should remain logically grouped.

Delpha allows you to define **custom merge rules** to group and control which fields are retained from the same record during a merge.

## Use Case Example: Ensuring Address Consistency

Let’s say you want to make sure that **Billing Street**, **Billing City**, and **Billing Country** all come from the **same source record** to avoid mixed-up data.

### Step-by-Step Setup in Delpha

#### Step 1: Go to the Merge Field Rules

1. Open the **Delpha Setup** app
2. Navigate to the **Duplicate Settings** tab
3. Select the target **object** (e.g., Account, Contact)
4. Scroll down to the  [**Merge Field Rules**](broken://pages/zuSTVBvmhFAlQ23LSJSV) section
5. Click **New Rule**

#### Step 2: Configure the Rule

| Field                  | Description                                                                               |
| ---------------------- | ----------------------------------------------------------------------------------------- |
| **Action**             | Select `Group and Customize` to apply rules across a group of fields                      |
| **Visible**            | Enable if you want this merge logic to be shown in the Delpha bot                         |
| **Selection Field**    | The field used to determine which record to pull grouped data from (e.g., `Billing City`) |
| **Override Rule**      | Rule applied to the selection field (e.g., `Master and Not Empty`)                        |
| **Main Display Field** | The field shown in the Delpha assistant UI (e.g., `Billing Street`)                       |

{% hint style="warning" %}
**Note:** Selection Field and Main Display Field can be **different**. For example, you can use a scoring field as the selection logic and display another field to the use
{% endhint %}

#### Step 3: Define Grouped Fields

Once the **source record** is selected using the selection rule:

* **Grouped Fields**: Add the fields you want to **pull from that same record**, e.g., `Billing Street`, `Billing City`, `Billing Country`
* **Tooltip Display Fields**: Fields shown when a user hovers over the record in the bot (only if "Visible" is enabled)
* **Hidden Fields**: Fields used in the rule but **not shown** to the end user

## Results

Using this setup, all defined fields will be pulled from the **same record** during a merge, ensuring consistency. The logic will be displayed in the Delpha bot if “Visible” is enabled, giving users clarity and control.

| **Master record**                                                                                                                                                   | <p><br><strong>Candidate</strong></p><p></p>                                                                                            | <p>Default Merging rule : <strong>Master and Not Empty</strong></p><p></p>                                                                                                                                                         | <p><strong>Grouping Rule based on City field</strong></p><p></p>                                                                                                                                                                     |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><strong>Billing Address</strong></p><p>Street: 3 ave Vavin</p><p>Zip code: <mark style="color:green;">\<Empty></mark></p><p>City: Paris</p><p>Country: Franc</p> | <p><strong>Billing Address</strong></p><p>Street: 1 rue Tabaga</p><p>Zip Code: 69100</p><p>City: Villeurbanne</p><p>Country: France</p> | <p><strong>Merged Address</strong></p><p>Street: 3 ave Vavin</p><p>Zip code: <mark style="color:red;">69100</mark></p><p>City: Paris</p><p>Country: France</p><p><em><strong>Zip comes from the Candidate record</strong></em></p> | <p><strong>Merged Address</strong></p><p>Street: 3 ave Vavin</p><p>Zip code: <mark style="color:green;">\<Empty></mark></p><p>City: Paris</p><p>Country: France</p><p><em><strong>Zip comes from the Master record</strong></em></p> |


---

# 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/what-is-field-grouping.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.
