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

# Context field maps

> Map each source's columns to the fields Matcher compares, from the Field Maps tab of a context in the Matcher module of Lerian Console.

Use the **Field Maps** tab of a context to tell Matcher how to read each source. A field map translates a source's columns into the canonical fields that the matching engine compares.

## Accessing the Field Maps tab

***

<Steps>
  <Step>
    In the Matcher module, select **Configure → Contexts**.
  </Step>

  <Step>
    Click a context to open its detail page.
  </Step>

  <Step>
    Select the **Field Maps** tab.
  </Step>
</Steps>

The **Map fields** step of the [Context setup wizard](/en/products/matcher/ui/context-setup-wizard) shows the same tab.

## Field map list

***

The tab shows one row for each source of the context. Archived sources do not appear. Each row shows the source name, its type, its side, and a summary of its map:

* **No field map yet**: the source has no map. Click **Add map** to create one.
* A count of mapped fields, followed by the first canonical fields. Use the pencil button to edit the map and the trash button to delete it.

If the context has no sources, the tab asks you to add them first. Click **Go to sources** to open the **Sources** tab.

<Note>
  Matcher activates a context only when each source on this tab has a field map. A source with a **camt.053 options** value other than **Auto** needs no field map. The camt.053 parser uses the ISO 20022 mapping. See [Context sources](/en/products/matcher/ui/context-sources).
</Note>

## Creating or editing a field map

***

<Steps>
  <Step>
    Click **Add map** on a source row, or the pencil button on a mapped source. The **Create field map** or **Edit field map** side sheet opens.
  </Step>

  <Step>
    Add one mapping row for each canonical field. In each row, type the canonical field on the left and the source column on the right. Click **Add field** to add a row. Click the trash button on a row to remove it.
  </Step>

  <Step>
    Optionally, fill in the **Debit and credit column** fields. See [Debit and credit column](#debit-and-credit-column).
  </Step>

  <Step>
    Click **Create map** for a new map, or **Save map** for an existing one.
  </Step>
</Steps>

Matcher refuses a map that misses a required field or uses a field outside this list:

| Canonical field | Required | Description |
| - | - | - |
| `external_id` | Yes | The transaction reference in the source |
| `amount` | Yes | The transaction amount |
| `currency` | Yes | The transaction currency |
| `date` | Yes | The transaction date |
| `description` | No | A description of the transaction |
| `fee_amount` | No | The fee charged on the transaction. Fee verification reads it |
| `fee_currency` | No | The currency of the fee |

Matcher keeps the source columns that the map does not use as transaction metadata. [Fee rules](/en/products/matcher/ui/context-fee-rules) can test those metadata fields.

### Debit and credit column

Some files do not put a minus sign on debit amounts. They mark each row as a debit or a credit in a separate column. For these files, fill in the three fields:

| Field | Description |
| - | - |
| **Column** | The source column that holds the debit or credit marker |
| **Value for a debit** | The marker of a debit row, for example `D` |
| **Value for a credit** | The marker of a credit row, for example `C` |

If you fill in one of the fields, fill in all three. The debit and credit values must be different. Matcher compares them without regard to case.

Matcher imports debit rows as negative amounts and credit rows as positive amounts. The amount column must then hold amounts without a sign. A row with a signed amount, or with a marker that matches neither value, fails to import.

## Suggesting mappings with AI

***

The editor has a **Suggest mappings with AI** panel. It reads a sample of the source file and proposes source columns for the canonical fields. Matcher sends a capped slice of the sample to the language-model provider Lerian configures for your environment.

<Steps>
  <Step>
    Paste a sample of the source file into **Source sample**. A header row and a few lines are enough.
  </Step>

  <Step>
    Click **Suggest mappings**. The panel lists each proposed mapping with a confidence meter.
  </Step>

  <Step>
    Click **Accept** on a proposal to copy it into the mapping rows.
  </Step>

  <Step>
    Review the rows, then save the map.
  </Step>
</Steps>

A proposal changes nothing in Matcher. Only the map you save takes effect.

If the panel shows **AI assist unavailable**, the mapping advisor is not available. Map the fields by hand.

## Deleting a field map

***

Click the trash button on a mapped source. A **Delete field map?** dialog opens. Click **Delete** to remove the map. Matcher keeps the source.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.