> ## Documentation Index
> Fetch the complete documentation index at: https://support.entegrata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Mapping Fields

> Step-by-step procedures for mapping source fields to entity fields in Entegrata data pipelines

## Overview

Field mapping is the core of creating data pipelines in Entegrata. You define how data from your source systems maps to the standardized fields in your entities. This guide covers everything from simple direct mappings to understanding data type compatibility and handling common mapping scenarios.

## Understanding Field Mapping

### What is Field Mapping?

Field mapping creates a connection between:

* **Source Field**: A column from your data source (e.g., `customer_name` from CRM)
* **Entity Field**: A standardized field in your entity (e.g., `Name`)

When data flows through your pipeline, values are transformed from source fields to entity fields based on these mappings.

<Frame>
  <img src="https://mintcdn.com/entegrata/RJ9eXpgfPSe7LJsv/images/pipelines/mapping_editor_field_trait_connection.png?fit=max&auto=format&n=RJ9eXpgfPSe7LJsv&q=85&s=9933d844b0674eb8d71c811cbce0e167" alt="Visual representation of field mapping from source to entity" width="1512" height="769" data-path="images/pipelines/mapping_editor_field_trait_connection.png" />
</Frame>

## Direct Field Mapping (Visual View)

### Basic Connection

<Steps>
  <Step title="Open the Mapping Editor">
    Navigate to your entity and open the mapping editor. Ensure you have at least one data source configured.

    <Frame>
      <img src="https://mintcdn.com/entegrata/RJ9eXpgfPSe7LJsv/images/pipelines/mapping_editor_view.png?fit=max&auto=format&n=RJ9eXpgfPSe7LJsv&q=85&s=48544978cc3bf891f608e1856c33bd24" alt="Mapping editor with source and entity nodes" width="1512" height="769" data-path="images/pipelines/mapping_editor_view.png" />
    </Frame>
  </Step>

  <Step title="Locate Source Field">
    Find the source field you want to map. You can add new fields to your source node through the **Edit Source** modal's Fields tab, which lets you search and select from available columns.

    <Frame>
      <img src="https://mintcdn.com/entegrata/RJ9eXpgfPSe7LJsv/images/pipelines/mapping_editor_add_source_field_modal.png?fit=max&auto=format&n=RJ9eXpgfPSe7LJsv&q=85&s=110430c25de5cf8be51ab7ba06635fe1" alt="Managing source fields in the Edit Source modal" width="1512" height="769" data-path="images/pipelines/mapping_editor_add_source_field_modal.png" />
    </Frame>
  </Step>

  <Step title="Locate Target Entity Field">
    On the right side, find the entity field you want to map to. Entity fields are shown with their data types.

    <Frame>
      <img src="https://mintcdn.com/entegrata/RJ9eXpgfPSe7LJsv/images/pipelines/mapping_editor_entity_side.png?fit=max&auto=format&n=RJ9eXpgfPSe7LJsv&q=85&s=17f2b584a73753dc3a4afb5b783c013b" alt="Entity node with field list" width="146" height="418" data-path="images/pipelines/mapping_editor_entity_side.png" />
    </Frame>
  </Step>

  <Step title="Drag to Connect">
    Click and hold on the source field, then drag to the entity field. Release to create the connection.

    An animated line appears showing the mapping relationship.

    <Frame>
      <img src="https://mintcdn.com/entegrata/RJ9eXpgfPSe7LJsv/images/pipelines/mapping_editor_field_trait_connection.png?fit=max&auto=format&n=RJ9eXpgfPSe7LJsv&q=85&s=9933d844b0674eb8d71c811cbce0e167" alt="Dragging connection between source and entity field" width="1512" height="769" data-path="images/pipelines/mapping_editor_field_trait_connection.png" />
    </Frame>
  </Step>
</Steps>

### Alternative: Edit Field Modal

Instead of dragging, you can configure mappings through the Edit Field modal:

<Steps>
  <Step title="Click Entity Field">
    Click on the entity field you want to map. This opens the **Edit Field** modal.
  </Step>

  <Step title="Open Data Source Tab">
    Switch to the **Data Source** tab in the modal.
  </Step>

  <Step title="Select Source and Field">
    Use the source and field dropdowns to select where the data comes from. The mapping is applied when you click **Save**.
  </Step>
</Steps>

## Understanding Data Type Compatibility

### Automatic Type Conversion

Entegrata automatically converts between compatible data types:

| Source Type   | Compatible Entity Types                              |
| ------------- | ---------------------------------------------------- |
| String/Text   | String, Integer (if numeric), Decimal, Boolean, Date |
| Integer       | String, Integer, Decimal, Boolean                    |
| Decimal/Float | String, Decimal, Integer (rounded)                   |
| Boolean       | String, Boolean, Integer (0/1)                       |
| Date/DateTime | String, Date, DateTime                               |
| JSON          | String, JSON                                         |

## Mapping from Multiple Sources

When you have related sources, you can map fields from any of them:

<Steps>
  <Step title="Identify Field Sources">
    Each source node is labeled. Fields show which source they come from.

    <Frame>
      <img src="https://mintcdn.com/entegrata/RJ9eXpgfPSe7LJsv/images/pipelines/mapping_editor_datasources_side.png?fit=max&auto=format&n=RJ9eXpgfPSe7LJsv&q=85&s=73b6ec652cb60b2df1c5ac2301323b2a" alt="Multiple source nodes with color coding" width="1512" height="769" data-path="images/pipelines/mapping_editor_datasources_side.png" />
    </Frame>
  </Step>

  <Step title="Map from Any Source">
    Connect entity fields to fields from either:

    * Primary source
    * Any related source
  </Step>

  <Step title="Handle Null Values">
    When mapping from related sources (joined with LEFT JOIN), some records may have null values.

    Consider:

    * Using COALESCE to provide fallback values
    * Setting default values

    <Frame>
      <img src="https://mintcdn.com/entegrata/RJ9eXpgfPSe7LJsv/images/pipelines/mapping_editor_multiRef_details.png?fit=max&auto=format&n=RJ9eXpgfPSe7LJsv&q=85&s=7be706fe7abce46b675f16b389e12974" alt="COALESCE example with multiple sources" width="1512" height="769" data-path="images/pipelines/mapping_editor_multiRef_details.png" />
    </Frame>
  </Step>
</Steps>

## Common Mapping Patterns

### Name Fields

Combining first and last name:

**Option 1: Use CONCAT transformation**

```
Source: FirstName, LastName
Combination: CONCAT(FirstName, ' ', LastName)
Entity Field: Name
```

**Option 2: Map separate fields**

```
Source: FirstName -> Entity: FirstName
Source: LastName -> Entity: LastName
```

### Address Fields

Mapping complete addresses:

**Single Field Address:**

```
Source: full_address -> Entity: Address
```

**Multi-Field Address:**

```
Source: street_address -> Entity: Street
Source: city -> Entity: City
Source: state -> Entity: State
Source: zip_code -> Entity: ZipCode
```

### Date and Time Fields

Common date/time mapping scenarios:

**Date Only:**

```
Source: created_date (DateTime) -> Entity: CreatedDate (Date)
(Time portion automatically truncated)
```

**Timestamp to Date and Time:**

```
Source: timestamp -> Entity: Date (extract date)
Source: timestamp -> Entity: Time (extract time)
```

### Boolean/Flag Fields

Mapping yes/no or true/false values:

**String to Boolean:**

```
Source: active (String: "Y"/"N") -> Entity: IsActive (Boolean)
Condition: "Y" = true, "N" = false
```

**Integer to Boolean:**

```
Source: enabled (Integer: 1/0) -> Entity: IsEnabled (Boolean)
Condition: 1 = true, 0 = false
```

**Complex Conditions:**
Use CASE expression for complex logic (see [Multi-Field Mapping](/data/pipeline/multi-field-mapping))

<Frame>
  <img src="https://mintcdn.com/entegrata/RJ9eXpgfPSe7LJsv/images/pipelines/mapping_editor_multiRef_details_case_filled.png?fit=max&auto=format&n=RJ9eXpgfPSe7LJsv&q=85&s=7473153ad169f1240d0f9a0d9e8c3999" alt="Boolean field mapping configurations" width="1512" height="769" data-path="images/pipelines/mapping_editor_multiRef_details_case_filled.png" />
</Frame>

### Numeric Fields

Mapping numbers with precision:

**Integer to Decimal:**

```
Source: quantity (Integer) -> Entity: Quantity (Decimal)
(Automatically converted with .00 decimal places)
```

**Decimal Precision:**

```
Source: price (Decimal 10,4) -> Entity: Price (Decimal 10,2)
(Automatically rounded to 2 decimal places)
```

## Unmapping Fields

To remove a field mapping:

### Visual View

<Steps>
  <Step title="Select Connection Line">
    Click on the connection line between source and entity field.

    <Frame>
      <img src="https://mintcdn.com/entegrata/RJ9eXpgfPSe7LJsv/images/pipelines/mapping_editor_field_trait_connection.png?fit=max&auto=format&n=RJ9eXpgfPSe7LJsv&q=85&s=9933d844b0674eb8d71c811cbce0e167" alt="Selected connection line" width="1512" height="769" data-path="images/pipelines/mapping_editor_field_trait_connection.png" />
    </Frame>
  </Step>

  <Step title="Delete Connection">
    Press **Delete** key, or right-click the connection line and select **Delete**.

    <Frame>
      <img src="https://mintcdn.com/entegrata/sWO-t3fu8JP8xl73/images/pipelines/mapping_editor_connection_context_menu.png?fit=max&auto=format&n=sWO-t3fu8JP8xl73&q=85&s=8b77a3ea146825176eaec4a683f804ba" alt="Context menu with remove option" width="1108" height="478" data-path="images/pipelines/mapping_editor_connection_context_menu.png" />
    </Frame>
  </Step>

  <Step title="Confirm if Prompted">
    If the field is required, you'll be asked to confirm removal.
  </Step>
</Steps>

## Remapping Fields

To change an existing mapping:

### Visual View

<Steps>
  <Step title="Delete Old Connection">
    Remove the existing connection as described above.
  </Step>

  <Step title="Create New Connection">
    Drag from the new source field to the entity field.
  </Step>
</Steps>

## Troubleshooting

### Cannot Map Field

**Issue**: Dragging a field doesn't create a connection.

**Solutions**:

* Check if entity field is already mapped (unmap first)
* Verify data types are compatible
* Ensure source node is properly connected

### Missing Fields in Dropdown

**Issue**: Expected source field doesn't appear in dropdown.

**Solutions**:

* Refresh source schema
* Verify you're looking at the correct source
* Check if field name has special characters (may be escaped)
* Ensure source connection is active
* Ensure field is enabled on the resource

## Best Practices

<Tip>
  **Field Naming**

  * Use consistent naming conventions
  * Match business terminology, not technical names
  * Document unusual mappings with comments
  * Consider future maintainability
</Tip>

<Tip>
  **Performance**

  * Map only fields you need
  * Avoid complex transformations when simple mapping works
  * Use source-level filters to reduce data volume
  * Consider data types impact on storage
</Tip>

## Related Topics

<CardGroup cols={2}>
  <Card title="Data Mapping Editor" icon="diagram-project" href="/data/pipeline/data-mapping-editor">
    Learn about the visual mapping editor interface
  </Card>

  <Card title="Multi-Field Mapping" icon="code-merge" href="/data/pipeline/multi-field-mapping">
    Advanced transformations with COALESCE, CONCAT, CASE
  </Card>

  <Card title="Field Management" icon="list" href="/data/pipeline/field-management">
    Add, edit, and configure entity fields
  </Card>

  <Card title="Default Values" icon="pen-to-square" href="/data/pipeline/default-values">
    Set default values for entity fields
  </Card>
</CardGroup>
