Skip to main content

Replace

Overview

Use the replace transform to find a given pattern of characters within incoming data and replace all instances of that pattern with alternate values. The transform recognizes standard regex syntax. See the References section for more information about regex.

Transform structure

The replace transform takes a regex attribute as an argument to identify which pattern to replace and a replacement attribute for the characters to replace the pattern with. The transform also requires the standard type and name attributes:

{
"attributes": {
"regex": "IIQ",
"replacement": "Identity Security Cloud"
},
"type": "replace",
"name": "Replace Transform"
}

Top-level properties (required)

  • type string (required)
    Must be set to replace.

  • name string (required)
    The name of the transform as it will appear in the UI's dropdown menus.

  • requiresPeriodicRefresh boolean (optional)
    Whether the transform logic should be reevaluated every evening as part of the identity refresh process. Default is false.

Attributes

The replace transform uses the following structure:

{
"type": "replace",
"name": "Transform Name",
"attributes": {
"regex": "pattern",
"replacement": "newValue"
}
}

attributes (required)

The attributes object contains the replacement configuration.

Required

  • regex string (required)
    The pattern to search for and replace. Supports standard regex syntax.

  • replacement string (required)
    The replacement string that replaces the pattern wherever it occurs.

Optional

  • input object (optional)
    Explicitly defines the input data passed into the transform. If not provided, the transform uses input from the source and attribute combination configured in the UI.

Examples

This transform makes a simple word replacement, exchanging "IIQ" for "Identity Security Cloud".

Input: "Working with IIQ is fun"
Output: "Working with Identity Security Cloud is fun"

Transform request body:

{
"attributes": {
"regex": "IIQ",
"replacement": "Identity Security Cloud"
},
"type": "replace",
"name": "Replace Transform"
}

 

This example uses a more complex regex pattern to remove any non-alphabet characters from the input string.

Input: "The quick brown fox jumped over 10 lazy dogs"
Output: "Thequickbrownfoxjumpedoverlazydogs"

Transform request body:

{
"attributes": {
"input": "The quick brown fox jumped over 10 lazy dogs",
"regex": "[^a-zA-Z]",
"replacement": ""
},
"type": "replace",
"name": "Replace Transform"
}

References