---
title: Transform attributes using a mapping
description: Use PingIDM mapping transforms to derive target attribute values from source attributes using scripts during synchronization
component: pingidm
version: 8.1
page_id: pingidm:synchronization-guide:mapping-transforming-attributes
canonical_url: https://docs.pingidentity.com/pingidm/8.1/synchronization-guide/mapping-transforming-attributes.html
llms_txt: https://docs.pingidentity.com/pingidm/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
keywords: ["Synchronization", "Attributes", "Mappings"]
section_ids:
  attribute-transformation-ui: Configure attribute transformation using the admin UI
  using_the_platform_admin_ui: Using the Platform admin UI
  using_the_legacy_admin_ui: Using the legacy admin UI
---

# Transform attributes using a mapping

You can use a mapping to define attribute transformations during synchronization. In the following sample mapping excerpt, the value of the `displayName` attribute on the target is set using a combination of the `lastName` and `firstName` attribute values from the source:

```json
{
    "source": "",
    "target": "displayName",
    "transform": {
        "type": "text/javascript",
        "source": "source.lastName +', ' + source.firstName;"
    }
},
```

For transformations, the `source` property is optional. However, a source object is only available if you specify the `source` property. Therefore, in order to use `source.lastName` and `source.firstName` to calculate the `displayName`, the example specifies `"source" : ""`.

If you set `"source" : ""` (not specifying an attribute), the entire object is regarded as the source, and you must include the attribute name in the transformation script. For example, to transform the source username to lowercase, your script would be `source.mail.toLowerCase();`. If you do specify a source attribute (for example, `"source" : "mail"`), just that attribute is regarded as the source. In this case, the transformation script would be `source.toLowerCase();`.

## Configure attribute transformation using the admin UI

|   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| - | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | Starting with IDM 8.1, the [legacy admin UI is deprecated](../release-notes/deprecated-functionality.html#legacy-admin-ui-deprecated) and is no longer bundled with IDM. New deployments should use the [Platform admin UI](../setup-guide/platform-admin-ui.html), which is the replacement for the legacy admin UI.Both UIs are available as separate downloads from the [Backstage download site](https://backstage.pingidentity.com/downloads):- To install the Platform admin UI, follow the steps in [Install the Platform admin UI for standalone IDM](../setup-guide/platform-admin-ui.html).

- To continue using the legacy admin UI, follow the steps in [Install the legacy admin UI](../setup-guide/legacy-admin-ui.html). |

### Using the Platform admin UI

To configure an attribute transformation using the Platform admin UI:

1. Open the [Advanced Sync](cfg-mapping-resource.html#mappings-platform-ui) editor for the mapping, and click the property to edit on the Mapping tab.

2. Select Apply transformation script.

3. Insert your transformation script into the Transformation Script editor.

4. Click Save.

### Using the legacy admin UI

To configure an attribute transformation using the legacy admin UI:

1. From the navigation bar, click Configure > Mappings, and select a mapping.

2. Select the line with the target attribute value to set.

3. On the Transformation Script tab, select Javascript or Groovy, and enter the transformation as an Inline Script, or specify the path to the file containing your transformation script.

When you use the UI to map a property with an encrypted value, you are prompted to set up a transformation script to decrypt the value when that property is synchronized. The resulting mapping looks similar to the following, which shows the transformation of a user's `password` property:

```json
{
    "target" : "userPassword",
    "source" : "password",
    "transform" : {
        "type" : "text/javascript",
        "globals" : { },
        "source" : "openidm.decrypt(source);"
    },
    "condition" : {
        "type" : "text/javascript",
        "globals" : { },
        "source" : "object.password != null"
    }
}
```
