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

# Map value using dictionary

> Converts input from one value into another using a lookup dictionary. For example, the value “1” into “One”, “Yes” into “Si”, etc.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Converts input from one value into another using a lookup dictionary. You give it a set of "from" and "to" pairs, and when an incoming value matches one of the "from" entries it is replaced by the matching "to" entry. This is ideal for translating codes between systems, for example turning a country code `"NL"` into `"Netherlands"`, or a status flag `"1"` into `"active"`. The list is checked from top to bottom and the first match wins; a value that matches nothing is passed through unchanged.

This documentation describes: [Schema](/schemas/mapper/dictionary-map)

## Fields

<FormField property="map" label="Map" required>
  The lookup list of value pairs. Each row has two parts: the value to look for ("from") and the value to replace it with ("to"). You need at least one row and can add as many as you need. Each value can be text, a number, a true/false toggle, or empty.
</FormField>

<FormField property="comparator" label="Comparator" diType="comparator">
  Decides how an incoming value is compared against the "from" entries. The default is an exact match, where the value and the "from" entry must be identical including their kind (the text `"1"` does not match the number `1`). Choose a different option here for looser matching, such as case-insensitive comparison.
</FormField>

## Sample data

| Field      | Value                                                       |
| ---------- | ----------------------------------------------------------- |
| Map        | `NL` to `Netherlands`, `BE` to `Belgium`, `DE` to `Germany` |
| Comparator | (default exact match)                                       |

Input:

```json theme={null}
{ "country": "NL" }
```

Output:

```json theme={null}
{ "country": "Netherlands" }
```

```json Configuration theme={null}
{
  "prototype": "dictionary-map",
  "parameters": {
    "map": [
      ["NL", "Netherlands"],
      ["BE", "Belgium"],
      ["DE", "Germany"]
    ]
  }
}
```
