Skip to content

Examples

Example 1: Simple Direct Mapping

Map a source field directly to a target field:

json
{
  "source": "MX_MAIL_PRIMARY",
  "target": "data/emails[0]/value"
}

Input: { "MX_MAIL_PRIMARY": "j.doe@acme.com" }Result: data.emails[0].value = "j.doe@acme.com"

Example 2: Constant Value

Set a fixed value regardless of input:

json
{
  "constant": "work",
  "target": "data/emails[0]/type"
}

Result: data.emails[0].type = "work" (always)

Example 3: Value from Header

Use a message header as the source:

json
{
  "header": "roiam_customer_system_name",
  "target": "data/srcRepository"
}

Result: if header roiam_customer_system_name = "REPO_NAME", then data.srcRepository = "REPO_NAME"

Example 4: Template with Multiple Sources

Combine multiple fields into one value:

json
{
  "source": ["MSKEYVALUE", "MX_MANAGER"],
  "target": "data/srcEntity/value",
  "transform": "template",
  "template": "query:Users?filter=userName eq '{{VALUE1}}'~id AND manager eq '{{VALUE2}}'"
}

Input: { "MSKEYVALUE": "JDOE001", "MX_MANAGER": "67890" }Result: data.srcEntity.value = "query:Users?filter=userName eq 'JDOE001'~id AND manager eq '67890'"

Example 5: Conditional — Different Source by Identity Type

Use a different source field depending on whether the user is an Employee or External:

json
{
  "target": "data/urn-._roiable-._roiam-._params-._scim-._schemas-._extension-._job-._2.0-._User/jobDetails[0]/company",
  "transform": "conditional",
  "conditions": [
    {
      "when": {
        "field": "MX_FS_IDENTITY_TYPE",
        "operator": "equals",
        "value": "Employee"
      },
      "source": "MX_FS_COMPANY_CODE"
    },
    {
      "when": {
        "field": "MX_FS_IDENTITY_TYPE",
        "operator": "equals",
        "value": "Contractor"
      },
      "source": "Z_VENDOR"
    }
  ],
  "default": { "constant": "UNKNOWN" }
}

Input (Employee): { "MX_FS_IDENTITY_TYPE": "Employee", "MX_FS_COMPANY_CODE": "ACME Corp" }Result: jobDetails[0].company = "ACME Corp"

Input (Contractor): { "MX_FS_IDENTITY_TYPE": "Contractor", "Z_VENDOR": "Vendor Inc" }Result: jobDetails[0].company = "Vendor Inc"

Input (Other): { "MX_FS_IDENTITY_TYPE": "Intern" }Result: jobDetails[0].company = "UNKNOWN"

Example 6: Conditional with Template Transform in Branch

Apply different formatting per condition:

json
{
  "target": "data/displayName",
  "transform": "conditional",
  "conditions": [
    {
      "when": {
        "field": "MX_FS_IDENTITY_TYPE",
        "operator": "equals",
        "value": "Employee"
      },
      "source": ["MX_FIRSTNAME", "MX_LASTNAME"],
      "transform": "template",
      "template": "{{VALUE1}} {{VALUE2}}"
    },
    {
      "when": {
        "field": "MX_FS_IDENTITY_TYPE",
        "operator": "startsWith",
        "value": "Ext"
      },
      "source": "DISPLAYNAME",
      "prefix": "[EXT] "
    }
  ],
  "default": { "source": "DISPLAYNAME" }
}

Input (Employee): { "MX_FS_IDENTITY_TYPE": "Employee", "MX_FIRSTNAME": "John", "MX_LASTNAME": "Doe" }Result: data.displayName = "John Doe"

Input (External): { "MX_FS_IDENTITY_TYPE": "External", "DISPLAYNAME": "Jane Smith" }Result: data.displayName = "[EXT] Jane Smith"

Example 7: Conditional Based on Header Value

Condition evaluated against a message header:

json
{
  "target": "data/reason",
  "transform": "conditional",
  "conditions": [
    {
      "when": {
        "field": "header:roiam_operation_mode",
        "operator": "equals",
        "value": "initial_load"
      },
      "header": "roiam_customer_system_name",
      "transform": "template",
      "template": "Initial load for system {{VALUE}}"
    },
    {
      "when": {
        "field": "header:roiam_operation_mode",
        "operator": "equals",
        "value": "delta"
      },
      "header": "roiam_customer_system_name",
      "transform": "template",
      "template": "Delta sync for system {{VALUE}}"
    }
  ]
}

Example 8: Conditional with exists Operator

Only map a field if the source value is present:

json
{
  "target": "data/phoneNumbers[0]/value",
  "transform": "conditional",
  "conditions": [
    {
      "when": { "field": "MX_PHONE_MOBILE", "operator": "exists" },
      "source": "MX_PHONE_MOBILE"
    },
    {
      "when": { "field": "MX_PHONE_OFFICE", "operator": "exists" },
      "source": "MX_PHONE_OFFICE"
    }
  ]
}

Behavior: Uses mobile phone if available, falls back to office phone, writes nothing if neither exists.

See also

  • Rule Reference — rule properties, path syntax, and transform type details