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

# Mapping

The Mapping function type transforms input data into output data using [formulas](/docs/references/formulas).

It is defined like this:

```yaml theme={null}
type: mapping
mapping:
  id:
    $var: input.record.id
  fullName:
    $concat:
      - $var: input.record.firstName
      - ' '
      - $var: input.record.lastName
```

The mapping is a YAML object where each key is an output field and the value is a [formula](/docs/references/formulas) expression.

## Variables

* `credentials` – Authentication credentials from the current connection
* `parameters` – Function-level and collection-level parameters combined
* Function-specific input variables

## Using in Actions and Flow Nodes

You can use this function in flow nodes with `transform-data` type.

It is structured a bit differently than the standard definition. Here is an example:

```yaml theme={null}
type: transform-data
config:
  output:
    outputField:
      $var: input.sourceField
```

## Using in Connector Files

When used in connector files, the mapping is written in a separate file named `<function-name>.map.yml` (or `<function-name>.yml`).

For example:

```yaml theme={null}
# Function that normalizes a contact response.
# File location: data/contacts/record-from-api.map.yml
id:
  $var: $.fields.id
createdAt:
  $var: $.fields.created_at
```
