> For the complete documentation index, see [llms.txt](https://docs.brigge.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.brigge.ai/documentation/brigge-for-transformers/pipelines/pipeline-nodes/map-node.md).

# Map node

## Overview

When syncing data between different systems, you define the relationship between source fields (i.e. the data fields a pipeline receives) and the corresponding fields in the target system.&#x20;

<figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2FjC9vkaibJYRRXhtm2IoG%2FField%20Mapping%20Diagram.svg?alt=media&amp;token=02110793-ed44-4202-ae2d-41840ec2b0e7" alt=""><figcaption></figcaption></figure>

Sometimes, source and target fields will be a like-for-like match (for example, `first_name` maps to `first_name`) but often, source values must be manipulated (transformed) before being sent to the target system. The *Map* node is used to define what data values to send from the source system into the target system, and any required transformations to achieve this:

Using [data schemas](/documentation/brigge-for-transformers/schemas.md) to describe the structure of data in source and target systems, you can [generate mappings manually](#working-with-mapping-rows) or with [AI assistance](#creating-mappings).&#x20;

{% hint style="info" %}
Mapped data fields are output in mapping row creation sequence.
{% endhint %}

## Creating mappings

{% stepper %}
{% step %}
**Access the mapping editor**

Click the *Map* node to access settings, then click `open editor`:

<div align="left" data-with-frame="true"><figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2FxpkK1C7Q00Rzi8eioIcJ%2Fcreate%20mapping%201g.png?alt=media&amp;token=7a9a0399-a261-4631-87ec-52d427b3b83e" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**Choose source and target schemas**

Select `source` and `target` schemas. For example:

<div data-with-frame="true"><figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2F3EYlTYKCT6Dx3XY1HFHx%2F1%20select%20schemas.gif?alt=media&amp;token=990ce6cc-aada-41c5-891a-f311086fb00a" alt=""><figcaption></figcaption></figure></div>

Choose a schema that reflects the expected structure of incoming data. You'll notice that schemas are categorised according to where they are used:

<table><thead><tr><th width="218.69921875">Category</th><th>Summary</th></tr></thead><tbody><tr><td>Favourites</td><td>If you have favourited schemas, a favourites category is always at the top of the schema list. You can favourite any schema from the schema selection list, for example:<br><br><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2FaIKJKpp7LYpvIFmPT9rJ%2Fschema%20favourite.png?alt=media&amp;token=83b529bd-1091-40b2-a199-b6b5f46e3ecc" alt=""></td></tr><tr><td>Current pipeline</td><td>If the current pipeline includes nodes that are configured to use a schema (e.g a <a href="/documentation/brigge-for-transformers/pipelines/pipeline-nodes/split-node.md">split</a> node), those schemas are shown here. </td></tr><tr><td>Systems</td><td>Schemas defined for <a href="/documentation/brigge-for-engineers/systems.md">system endpoints</a>.</td></tr><tr><td>Pipelines</td><td>Schemas used in other pipelines (but not this one).  </td></tr><tr><td>Uncategorised</td><td>Schemas created from <a href="/documentation/brigge-for-transformers/schemas.md">general settings</a> and not applied to any systems or pipelines. </td></tr></tbody></table>

Data fields for the selected schemas are displayed in the left (source) and right (target) panels, ready to map.
{% endstep %}

{% step %}
**Generate mappings with AI**

Unless your mappings are particularly complex, allowing AI to take a first pass at mapping the two schemas is recommended:

<div data-with-frame="true"><figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2FVFlCg7W7gFt3RzsvedkH%2F2%20generate%20with%20ai.gif?alt=media&amp;token=6d5dcdb2-b5a0-409b-9c3c-70ac15fc2115" alt=""><figcaption></figcaption></figure></div>

Mappings are generated, with mapped fields indicated by a green marker. You can now [review the mappings and make any adjustments needed](#working-with-mapping-rows).
{% endstep %}
{% endstepper %}

## Working with mapping rows

<details>

<summary>Checking specific source and target mappings</summary>

To check a specific mapping, select the target field from the `outputs` panel; corresponding source field(s) are highlighted in the `inputs` panel.&#x20;

To continue checking another mapping, click the `clear` button to clear current selections, then choose another target field to review.

<div data-with-frame="true"><figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2FoxAVUo8Hk3M1GDzd1gVS%2F3%20check%20mappings%20b.gif?alt=media&amp;token=9f67016e-dc24-4dec-a4aa-ab97582c42a1" alt=""><figcaption></figcaption></figure></div>

</details>

<details>

<summary>Mapping a source and target field manually</summary>

You might choose to map:

* One source field to one target field (below)
* [One source field to multiple target fields](#mapping-multiple-source-fields-to-a-single-target-field)
* [Multiple source fields to one target field](#mapping-multiple-source-fields-to-a-single-target-field)

To map single source and target fields manually, select the required fields from `input` and `output` panels, then click the `add row` button between the two panels.&#x20;

{% hint style="info" %}
When you click a source or target field, you are selecting it to be mapped. If you make a mistake and choose the wrong field(s), use the `clear` button to clear current selections and start again. If you want to clear ALL mapped rows and start again, use the `clear mapping` button at the bottom of the map editor.&#x20;
{% endhint %}

<div data-with-frame="true"><figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2FBTkD3MiVqNnhi7YwIFUk%2F4%20add%20manual%20row.gif?alt=media&amp;token=c3402810-94f4-493a-98b3-7adb56a46ac5" alt=""><figcaption></figcaption></figure></div>

</details>

<details>

<summary>Mapping one source field to multiple target fields</summary>

When one source field is mapped to multiple target fields, the same source value is output to all selected target fields.&#x20;

To do this, select the required fields from `input` and `output` panels, then click the `add row` button between the two panels. In this case, you will select one field on the left, and multiple fields on the right.&#x20;

{% hint style="info" %}
When you click a source or target field, you are selecting it to be mapped. If you make a mistake and choose the wrong field(s), use the `clear` button to clear current selections and start again. If you want to clear ALL mapped rows and start again, use the `clear mapping` button at the bottom of the map editor.&#x20;
{% endhint %}

If you then select one of the mapped target fields, all fields for the mapping row are shown.

<div data-with-frame="true"><figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2FRXkiP0LpO0AdG317B1Wy%2F5%20map%20one%20to%20many.gif?alt=media&amp;token=bae68ed9-0032-40c9-bc14-85dad97c3d76" alt=""><figcaption></figcaption></figure></div>

</details>

<details>

<summary>Mapping multiple source fields to a single target field</summary>

There may be times where you need to combine multiple source fields and send the combined value into the target field. A common example is where one system outputs `first name` and `last name` and another expects a `full name`.

To map multiple source fields to a single target, select the required fields from `input` and `output` panels, then click the `add row` button between the two panels. In this case, you will select multiple fields on the left, and one on the right.&#x20;

{% hint style="info" %}
When you click a source or target field, you are selecting it to be mapped. If you make a mistake and choose the wrong field(s), use the `clear` button to clear current selections and start again. If you want to clear ALL mapped rows and start again, use the `clear mapping` button at the bottom of the map editor.&#x20;
{% endhint %}

If you then select one of the mapped target fields, all fields for the mapping row are shown.

Next, you must add [transformations](#adding-transformations) to manipulate source fields into one value, before being sent to the target. &#x20;

{% hint style="warning" %}
You must apply [transformations](#adding-transformations) to combine multiple source fields into one. Without this step, the mapping won't work as expected.&#x20;
{% endhint %}

<div data-with-frame="true"><figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2FDohCMyFIqCe9hDTLUE2i%2F6%20map%20many%20to%20one.gif?alt=media&amp;token=ddfc9cab-b5b6-40f1-83f0-c4d116e3fef9" alt=""><figcaption></figcaption></figure></div>

</details>

<details>

<summary>Updating an existing mapping</summary>

To add or remove a field for an existing mapping, select the row to display mapped source and target fields. To remove a mapped field, click it once (so it becomes unselected), then click the `update row` button between the two panels.

{% hint style="info" %}
The `update row` button becomes active as soon as you select an existing mapped row.
{% endhint %}

<div data-with-frame="true"><figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2Fd1DiOaJiGV7lTBt1cj3N%2F7%20update%20mapping.gif?alt=media&amp;token=ee53382b-a6bc-48e0-9dd6-624a59a323fe" alt=""><figcaption></figcaption></figure></div>

</details>

<details>

<summary>Deleting a mapping row</summary>

To delete an existing mapping, select the row to display mapped fields and then click any mapped `source` fields (so they become unselected).&#x20;

As soon as a mapping row has no defined source fields, a `delete row` button becomes available between the two panels. Click this to remove this mapping row.

<div data-with-frame="true"><figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2FbpxXoOd9qXJ2s6avf7bp%2F8%20delete%20mapping%20row.gif?alt=media&amp;token=e17ce467-aacd-4d78-834d-57dae1211d2f" alt=""><figcaption></figcaption></figure></div>

</details>

## Adding transformations

Transforms are used to change the value, format, and/or shape of data for onward processing. They are used in different places throughout Brigge.

In the *Map* node, you can define transformations to manipulate source values before they are output for the target. For example, you might need to convert a text field to numeric, lowercase to uppercase, join two separate fields, etc.&#x20;

A mapping row can have as many transforms as needed. When multiple transforms are applied, they are processed in sequence (so one can build on the output from its predecessor).&#x20;

To add a transform for an existing mapping row, follow the steps below.

{% hint style="info" %}
For a summary of available transformations, see [Data transformations](/documentation/brigge-for-transformers/pipelines/data-transformations.md).
{% endhint %}

{% stepper %}
{% step %}
**Select the mapping row(s) to be transformed**

In the example below, the selected rows map `first` and `last` source fields to a single target `name` field:

<div data-with-frame="true"><figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2Flwp8i12ogWM2IpElsnbT%2Fconcat%20map%200.png?alt=media&amp;token=b14a88a6-91bc-4e65-a9c3-e609e7a1c4c4" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
Typically, transformations are used to manipulate incoming data - i.e. transforming incoming source data for onward processing. However, you can also use transformations to inject data into target fields when no source value is received.&#x20;

For example, a target system might require values for a `currency` field, which is not part of incoming source data. In this scenario, you might apply a [custom value](/documentation/brigge-for-transformers/pipelines/data-transformations.md#custom-value) transformation to the target field, with the required currency value.  &#x20;
{% endhint %}

For this example, we will use a transform to join `first` and `last` source field values and send the transformed value to the target `name` field.
{% endstep %}

{% step %}
**Add a new transform**

Click the 'plus' icon in the transforms section. For example:

<div data-with-frame="true"><figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2FcSx23Iuk7fOO6BojRyRH%2Fconcat%20select%20transformm.png?alt=media&amp;token=710a2064-225f-4366-a448-a09ab745f509" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**Choose a transform type**

Use the `transform type` dropdown list to select the transformation function needed. For our example, we select the concat transform, to concatenate selected input fields:

<div data-with-frame="true"><figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2FVyVCDlJQrh3XEFuEzM5v%2F3%20choose%20transform%20type.png?alt=media&amp;token=fbe31001-3b78-4662-9169-c295fb829738" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**Configure the transformation**&#x20;

Required configuration varies according to the the selected transform type. For our `concat` example, the settings are:

<div data-with-frame="true"><figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2FnEfp4gizpEIFIUbnLbLs%2Fconcat%20config%203.png?alt=media&amp;token=428a46b0-e044-482c-898b-d484e85735d5" alt=""><figcaption></figcaption></figure></div>

Different transformations require different settings however, general field behaviour is common:

<table><thead><tr><th width="173.7637939453125">Field</th><th>Summary</th></tr></thead><tbody><tr><td>Value to transform</td><td>Provided you selected the full mapping row before choosing to add the transformation, the default value will be the last input field in the mapping. You can choose an alternative input from this dropdown list.</td></tr><tr><td>Inputs</td><td>Select any inputs to be processed by the transformation. The dropdown list will include all input fields for the selected mapping, outputs for previous transformations processed for this mapping, and <a href="/documentation/brigge-for-transformers/pipelines/pipeline-variables.md#system-variables">system variables</a>. </td></tr></tbody></table>

In our example:

* `value to transform` defaulted to last\_name but we changed it to first\_name (the first input field required in the join).&#x20;
* `delimiter` is entered as a space, as we need a space between first and last name values
* `input field 2` is added for the second field in the join (you can add more inputs if needed).

{% hint style="info" %}
Remember, this is just one example of a transformation - different transform types require different settings.&#x20;
{% endhint %}
{% endstep %}

{% step %}
**Confirm transform settings**&#x20;

Having clicked `done` to confirm transform settings, the transform is displayed in the mapping editor when this mapping row is selected. For example:

<div data-with-frame="true"><figure><img src="https://2172380191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8IqdqwZowcxtFpZfLa6k%2Fuploads%2Fbqilk1oVOkiHG7lxswfQ%2Fconcat%20added.png?alt=media&amp;token=32408603-4f59-454d-a755-5f4ca4b840d0" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**Update the mapping row**

Click `update row` to apply the transform, then save changes.
{% endstep %}
{% endstepper %}
