---
title: Script triggers defined in mappings
description: For information about how managed objects in mappings are handled, and the script triggers available, refer to Object-Mapping Objects.
component: pingidm
version: 8.1
page_id: pingidm:scripting-guide:script-triggers-mappings
canonical_url: https://docs.pingidentity.com/pingidm/8.1/scripting-guide/script-triggers-mappings.html
keywords: ["Scripting", "Triggers", "Managed Objects", "Mappings"]
section_ids:
  object_mapping_object: Object-mapping object
  property_object: Property object
  policy_object: Policy object
---

# Script triggers defined in mappings

For information about how managed objects in mappings are handled, and the script triggers available, refer to [Object-Mapping Objects](../synchronization-guide/synchronization-ref.html#sync-object-mapping).

## Object-mapping object

| Trigger                                                      | Variable                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `correlationQuery`, `correlationScript`*Returns JSON object* | * **source**: Represents the source object.

* **linkQualifier**: The link qualifier associated with the current sync.

* **context**: Information related to the current request, such as source and target.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `linkQualifiers`*Returns JSON object*                        | - **mapping**: The name of the current mapping.

- **object**: The value of the source object. During a DELETE event, that source object may not exist, and may be null.

- **oldValue**: The former value of the deleted source object, if any. If the source object is new, oldValue will be null. When there are deleted objects, oldValue is populated only if the source is a managed object.

- **returnAll** (boolean): Link qualifier scripts must return every valid link qualifier when returnAll is true, independent of the source object. If returnAll is true, the script must not attempt to use the object variable, because it will be null. It's best practice to configure scripts to start with a check for the value of returnAll.

- **context**: Information related to the current request, such as source and target.                                                                           |
| `onCreate`*Returns JSON object*                              | * **source**: Represents the source object.

* **target**: Represents the target object.

* **situation**: The situation associated with the current sync operation.

* **linkQualifier**: The link qualifier associated with the current sync operation.

* **context**: Information related to the current sync operation.

* **sourceId**: The object ID for the source object.

* **targetId**: The object ID for the target object.

* **mappingConfig**: A configuration object representing the mapping being processed.                                                                                                                                                                                                                                                                                                                                                                                          |
| `onDelete`, `onUpdate`*Returns JSON object*                  | - **source**: Represents the source object.

- **target**: Represents the target object.

- **oldTarget**: Represents the target object prior to the DELETE or UPDATE action.

- **oldSource**: Available during UPDATE and DELETE operations performed through implicit sync. When implicit synchronization triggers on a specific change to the source object, it can populate `oldSource` with the prior value. During reconciliation and liveSync operations, `oldSource` is undefined.

- **situation**: The situation associated with the current sync operation.

- **linkQualifier**: The link qualifier associated with the current sync.

- **context**: Information related to the current sync operation.

- **sourceId**: The object ID for the source object.

- **targetId**: The object ID for the target object.

- **mappingConfig**: A configuration object representing the mapping being processed. |
| `onLink`, `onUnlink`*Returns JSON object*                    | * **source**: Represents the source object.

* **target**: Represents the target object.

* **oldSource**: Available during UPDATE and DELETE operations performed through implicit sync. When implicit synchronization triggers on a specific change to the source object, it can populate `oldSource` with the prior value. During reconciliation and liveSync operations, `oldSource` is undefined.

* **linkQualifier**: The link qualifier associated with the current sync operation.

* **context**: Information related to the current sync operation.

* **sourceId**: The object ID for the source object.

* **targetId**: The object ID for the target object.

* **mappingConfig**: A configuration object representing the mapping being processed.                                                                                                                                                        |
| `onError`*Returns JSON object*                               | - **source**: Represents the source object.

- **target**: Represents the target object.

- **linkQualifier**: The link qualifier associated with the current sync operation.

- **context**: Information related to the current sync operation.

- **situation**: The situation associated with the current sync operation.

- **sourceId**: The object ID for the source object.

- **targetId**: The object ID for the target object.

- **oldSource**: Available during UPDATE and DELETE operations performed through implicit sync. When implicit synchronization triggers on a specific change to the source object, it can populate `oldSource` with the prior value. During reconciliation and liveSync operations, `oldSource` is undefined.

- **error**: The result of the resource exception, as a JSON object.

- **mappingConfig**: A configuration object representing the mapping being processed.      |
| `postMapping`*Returns JSON object*                           | * **source**: Represents the source object.

* **target**: Represents the target object.

* **oldSource**: Available during UPDATE and DELETE operations performed through implicit sync. When implicit synchronization triggers on a specific change to the source object, it can populate `oldSource` with the prior value. During reconciliation and liveSync operations, `oldSource` is undefined.

* **oldTarget**: Represents the target object prior to any changes.

* **linkQualifier**: The link qualifier associated with the current sync operation.

* **context**: Information related to the current sync operation.

* **sourceId**: The object ID for the source object.

* **targetId**: The object ID for the target object.

* **mappingConfig**: A configuration object representing the mapping being processed.                                                                                   |
| `result`*Returns JSON object of reconciliation results*      | - **source**: Provides statistics about the source phase of the reconciliation.

- **target**: Provides statistics about the target phase of the reconciliation.

- **context**: Information related to the current operation, such as source and target.

- **global**: Provides statistics about the entire reconciliation operation.

- **mappingConfig**: A configuration object representing the mapping being processed.

- **reconState**: Provides the state of reconciliation operation; such as, *success*, *failure*, or *active*.                                                                                                                                                                                                                                                                                                                                                                            |
| `validSource`*Returns boolean*                               | * **source**: Represents the source object.

* **linkQualifier**: The link qualifier associated with the current sync operation.

* **context**: Information related to the current sync operation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `validTarget`*Returns boolean*                               | - **target**: Represents the target object.

- **linkQualifier**: The link qualifier associated with the current sync operation.

- **context**: Information related to the current sync operation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

## Property object

| Trigger                          | Variable                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `condition`*Returns boolean*     | * **object**: The current object being mapped.

* **context**: Information related to the current operation, such as source and target.

* **linkQualifier**: The link qualifier associated with the current sync operation.

* **target**: Represents the target object.

* **oldTarget**: Represents the target object prior to any changes.

* **oldSource**: Available during UPDATE and DELETE operations performed through implicit sync. When implicit synchronization triggers on a specific change to the source object, it can populate `oldSource` with the prior value. During reconciliation and liveSync operations, `oldSource` is undefined. |
| `transform`*Returns JSON object* | - **source**: Represents the source object.

- **linkQualifier**: The link qualifier associated with the current sync operation.

- **context**: Information related to the current sync operation.                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

## Policy object

| Trigger                                 | Variable                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `action`*Returns string OR JSON object* | * **source**: Represents the source object.

* **target**: Represents the target object.

* **sourceAction** (boolean): Indicates whether the action is being processed during the source or target synchronization phase (true if performed during a source synchronization, false if performed during a target synchronization).

* **linkQualifier**: The link qualifier used for this operation (`default` if no other link qualifier is specified).

* **context**: Information related to the current sync operation.

* **recon**: Represents the reconciliation operation.

* The `recon.actionParam` object contains information about the current reconciliation operation and includes the following variables:

  * `reconId`: The ID of the reconciliation operation.

  * `mapping`: The mapping for which the reconciliation was performed, for example, `systemLdapAccounts_managedUser`.

  * `situation`: The situation encountered, for example, `AMBIGUOUS`.

  * `action`: The default action that would be used for this situation, if not for this script. The script being executed replaces the default action (and is used instead of any other named action).

  * `sourceId`: The `_id` value of the source record.

  * `linkQualifier`: The link qualifier used for that mapping, (`default` if no other link qualifier is specified).

  * `targetId`: The `_id` value of the target record involved in a reconciliation. In a `CONFIRMED` situation, the `targetId` points to the already linked target. If there is no target, the `targetId` is undefined.

  * `ambiguousTargetIds`: An array of the target record IDs that were found in an `AMBIGUOUS` situation during correlation.

  * `_action`: The synchronization action (only `performAction` is supported). |
| `postAction`*Returns JSON object*       | - **source**: Represents the source object.

- **target**: Represents the target object.

- **action**: The sync action that was performed.

- **sourceAction** (boolean): Indicates whether the action is being processed during the source or target synchronization phase (true if performed during a source synchronization, false if performed during a target synchronization).

- **linkQualifier**: The link qualifier used for this operation (`default` if no other link qualifier is specified).

- **reconId**: Represents the ID of the reconciliation.

- **situation**: Represents the situation for this policy.

- **context**: Information related to the current operation, such as source and target.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
