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

# Attribute mapping

> Map fields from a connected directory source to Iru Identity profile attributes, and transform values using IQL expressions before they reach user profiles.

When Iru reads people from a connected source, it needs to know which incoming
field fills which Iru profile attribute - and sometimes how to reshape the value
along the way. You describe that with an **attribute mapping**: for each Iru
profile attribute, you write an **expression** that produces its value from the
source's fields.

<Note>
  **Where attribute mapping applies.** You write attribute mappings when you
  **connect a source system** - the [Workday](/en/identity/directory/hris-workday)
  and [BambooHR](/en/identity/directory/hris-bamboohr) connectors, which expose
  their own fields for you to map. It does **not** apply to
  [CSV import](/en/identity/directory/importing-users): a CSV uses a fixed set of
  predefined columns, so there are no expressions to write.
</Note>

<Info>
  Mapping expressions are written in **IQL** - the same expression language Iru
  uses for [application claim and attribute
  mapping](/en/identity/getting-started/iql-expressions), Auto Group rules, and
  list filters. This page covers mapping a connected **source system's** fields into
  your directory's [profile attributes](/en/identity/directory/schema);
  see [IQL expressions](/en/identity/getting-started/iql-expressions) for the full
  syntax.
</Info>

## How a mapping works

Each row in a mapping pairs one **target** - an Iru profile attribute - with an
**expression** that draws from the **source** fields.

```mermaid theme={null}
flowchart LR
  subgraph source["Source fields"]
    a["first_name"]
    b["email_work"]
  end
  expr["IQL expression"] --> target["Iru profile attribute"]
  a --> expr
  b --> expr
```

<Steps>
  <Step title="Discover the source fields" icon="magnifying-glass">
    Iru reads the set of fields your source makes available. Those field names
    become the **identifiers** you can reference in expressions. See
    [Directory Sync](/en/identity/directory/directory-sync) for how
    discovery fits into setup.
  </Step>

  <Step title="Write an expression per attribute" icon="code">
    For each Iru attribute you want to fill, write an IQL expression. The simplest
    is just the source field name; more involved expressions combine or transform
    fields.
  </Step>

  <Step title="Iru validates it" icon="circle-check">
    Expressions are checked as you type and again when you save, so mistakes -
    an unknown field, a type error - surface before they ever reach a sync.
  </Step>

  <Step title="It runs on every sync" icon="arrows-rotate">
    When the sync runs, Iru evaluates each expression against the incoming row and
    writes the result to the attribute.
  </Step>
</Steps>

<Tip>
  Choose one stable, unique source field for the identifier that ties a source
  record to an Iru user, so each sync resolves to exactly one person.
</Tip>

## Writing expressions

Expressions reference your source's fields and can transform them - upper/lower
casing, splitting, concatenation, picking a list item, and so on. The full
reference (objects, functions, operators, and examples) is on the
[IQL expressions](/en/identity/getting-started/iql-expressions) page, since the same
language powers both directory mapping and application mapping.

A few quick examples:

```
// Use a field as-is
work_email

// Combine fields into a display name
first_name + " " + last_name

// The local part of an email, before the @
work_email.split("@")[0]
```

## Where to go next

<CardGroup cols={2}>
  <Card title="IQL expressions" icon="brackets-curly" href="/en/identity/getting-started/iql-expressions">
    The full IQL reference - objects, functions, operators, and examples.
  </Card>

  <Card title="Directory Sync" icon="building-user" href="/en/identity/directory/directory-sync">
    Connect an HR system and set up the mappings these expressions power.
  </Card>

  <Card title="Profile attributes" icon="table-list" href="/en/identity/directory/schema">
    The targets your expressions write into.
  </Card>

  <Card title="Auto Groups" icon="wand-magic-sparkles" href="/en/identity/directory/auto-groups">
    Another place attributes drive automation in your directory.
  </Card>
</CardGroup>
