# Error with Transform

**URL:** <https://developer.sailpoint.com/discuss/t/error-with-transform/205017>\
**Category:** SHF Discussion and Questions\
**Tags:** sailpoint-identity-security\
**Created:** [April 21, 2026, 9:17pm UTC](https://developer.sailpoint.com/discuss/t/error-with-transform/205017 "2026-04-21T21:17:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![vic\_rinkenberger](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vic_rinkenberger/32/37305_2.png) [@vic\_rinkenberger](https://developer.sailpoint.com/discuss/u/vic_rinkenberger)\
**Post date:** [April 21, 2026, 9:17pm UTC](https://developer.sailpoint.com/discuss/t/error-with-transform/205017/1 "2026-04-21T21:17:19Z")

</div>

I have create a Transform that is throwing an error:

_There was an exception while calculating the value for this attribute. Error during transformation for attribute: cfsalesforcealias (Transform ID: Calculate cfsalesforcealias) Cause: An empty regex expression may not be used for target value:_

```auto
{
    "name": "Calculate alias",
    "type": "substring",
    "attributes": {
        "begin": 0,
        "end": 8,
        "input": {
            "type": "replaceAll",
            "attributes": {
                "table": {
                    " ": ""
                },
                "input": {
                    "type": "accountAttribute",
                    "attributes": {
                        "sourceName": "HR",
                        "attributeName": "Display_Name"
                    }
                }
            }
        }
    },
    "internal": false
}

```

I’m sure the fix is obvious. Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![Tursun](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/tursun/32/36674_2.png) [@Tursun](https://developer.sailpoint.com/discuss/u/Tursun)\
**Post date:** [April 21, 2026, 9:38pm UTC](https://developer.sailpoint.com/discuss/t/error-with-transform/205017/2 "2026-04-21T21:38:26Z")

</div>

```json
{
  "name": "Calculate alias",
  "type": "substring",
  "attributes": {
    "begin": 0,
    "end": 8,
    "input": {
      "type": "replace",
      "name": "Remove Spaces",
      "attributes": {
        "regex": "\\s+",
        "replacement": "",
        "input": {
          "type": "accountAttribute",
          "name": "Get Display Name",
          "attributes": {
            "sourceName": "HR",
            "attributeName": "Display_Name"
          }
        }
      }
    }
  },
  "internal": false
}

```

Can you try above please. Thanks

---

<div class="post-metadata">

**Author:** ![amulpuru](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/amulpuru/32/39238_2.png) [@amulpuru](https://developer.sailpoint.com/discuss/u/amulpuru)\
**Post date:** [April 21, 2026, 10:11pm UTC](https://developer.sailpoint.com/discuss/t/error-with-transform/205017/3 "2026-04-21T22:11:17Z")

</div>

Hi @vic_rinkenberger , are you trying to calc alis out of display name attribute right without any spaces of 0-8 chars

Can you try below

```auto
{"name": "Calculate alias",
"type": "substring",
"attributes": {
    "begin": 0,
    "end": 8,
    "input": {
        "type": "replace",
        "name": "Remove Spaces",
        "attributes": {
            "regex": " ",
            "replacement": "",
            "input": {
                "type": "accountAttribute",
                "name": "Get Display Name",
                "attributes": {
                    "sourceName": "HR",
                    "attributeName": "Display_Name"

               }
           }
       }
   }
}

```

Thanks ,

Avinash Mulpuru

---

<div class="post-metadata">

**Author:** ![punna0001](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/punna0001/32/42011_2.png) [@punna0001](https://developer.sailpoint.com/discuss/u/punna0001)\
**Post date:** [April 22, 2026, 10:58am UTC](https://developer.sailpoint.com/discuss/t/error-with-transform/205017/4 "2026-04-22T10:58:42Z")

</div>

Fixed: Replace hardcoded two whitespaces with `“\\s+"` in replaceAll transform.

 ![Solution](https://global.discourse-cdn.com/sailpoint/original/3X/5/9/59c6d17e9945d15aa310b612204c9add180cc658.png)

The issue wasn’t with the transform structure, but with how `replaceAll` was being used.

the transform was using a hardcoded two-space pattern instead of a regex pattern for whitespace matching. `“\\s+"` matches one or more consecutive whitespace characters.

---

<div class="post-metadata">

**Author:** ![vic\_rinkenberger](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vic_rinkenberger/32/37305_2.png) [@vic\_rinkenberger](https://developer.sailpoint.com/discuss/u/vic_rinkenberger)\
**Post date:** [April 22, 2026, 3:08pm UTC](https://developer.sailpoint.com/discuss/t/error-with-transform/205017/5 "2026-04-22T15:08:54Z")

</div>

Thanks! This worked.

---

<div class="post-metadata">

**Author:** ![Tursun](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/tursun/32/36674_2.png) [@Tursun](https://developer.sailpoint.com/discuss/u/Tursun)\
**Post date:** [April 22, 2026, 4:01pm UTC](https://developer.sailpoint.com/discuss/t/error-with-transform/205017/6 "2026-04-22T16:01:03Z")

</div>

`replaceAll` with “\\s+” works in this case. However, as clean solution I’d use `replace` because it have only one pattern to remove. if there are multiple replace operations patterns `replaceAll` with table of key-value pairs would better. Thanks

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [June 21, 2026, 4:01pm UTC](https://developer.sailpoint.com/discuss/t/error-with-transform/205017/7 "2026-06-21T16:01:46Z")

</div>

Closed on June 21, 2026, 4:01pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
