---
title: Script triggers
description: Scripts can be triggered in different places, and by different events. The following list indicates the configuration files in which scripts can be referenced, the events upon which the scripts can be triggered, and the actual scripts that can be triggered on each of these files.
component: pingidm
version: 8.1
page_id: pingidm:scripting-guide:script-triggers
canonical_url: https://docs.pingidentity.com/pingidm/8.1/scripting-guide/script-triggers.html
keywords: ["Scripting", "Triggers"]
---

# Script triggers

|   |                                                                                                               |
| - | ------------------------------------------------------------------------------------------------------------- |
|   | For more information about the variables available to scripts, refer to [Script variables](script-vars.html). |

Scripts can be triggered in different places, and by different events. The following list indicates the configuration files in which scripts can be referenced, the events upon which the scripts can be triggered, and the actual scripts that can be triggered on each of these files.

* Scripts called in [mappings](../synchronization-guide/mappings.html)

  * Triggered by situation

    onCreate, onUpdate, onDelete, onLink, onUnlink

  * Object filter

    validSource, validTarget

  * Triggered when correlating objects

    correlationQuery, correlationScript

  * Triggered on any reconciliation

    result

  * Scripts inside properties

    condition, transform

    `sync.json` supports only one script per hook. If multiple scripts are defined for the same hook, only the last one is kept.

  * Scripts inside policies

    condition

    Within a synchronization policy, you can use a `condition` script to apply different policies based on the link type, for example:

    ```json
    "condition" : {
      "type" : "text/javascript",
      "source" : "linkQualifier == \"user\""
    }
    ```

* Scripts called in the managed object configuration *(tooltip: You can edit the managed object configuration over REST at the config/managed endpoint, or directly in the conf/managed.json file.)*

  onCreate, onRead, onUpdate, onDelete, onValidate, onRetrieve, onStore, onSync, postCreate, postUpdate, and postDelete

  The managed object configuration *(tooltip: You can edit the managed object configuration over REST at the config/managed endpoint, or directly in the conf/managed.json file.)* supports only one script per hook. If multiple scripts are defined for the same hook, only the last one is kept.

* Scripts called in the router configuration *(tooltip: You can edit the router configuration over REST at the config/router endpoint, or directly in the conf/router.json file.)*

  onRequest, onResponse, onFailure

  The router configuration *(tooltip: You can edit the router configuration over REST at the config/router endpoint, or directly in the conf/router.json file.)* supports multiple scripts per hook.
