Combining ReplaceAll + Left Pad transforms

Hello Colleagues,

I’m looking for help with building of the combined transform.

So the initial input from the Account Attribute is 00002121UK

The first action shall remove UK from the value, so I expect 00002121
Then I need to normalize the 00002121 to 10 digits value to add 2 “0” in the beginning to get 0000002121.

For these purposes I’m trying to combine “ReplaceAll” with “Left Pad”.
Here is the code snippet.

{
  "attributes": {
    "padding": "0",
    "length": "10",
  },
  "type": "leftPad",
  "name": "Left Pad Transform",
  "input": {
    "type": "replaceAll",
    "attributes": {
      "table": {
        "[a-zA-z]": ""
      }
    },
  }
}

Probably because of the syntax issue but after Transform upload to Sailpoint tenant I’m getting the only part of it.

Can u assist me with this?
Thank you

Hey there! The input section should be inside the attributes section.

Give this a try:

{
    "attributes": {
        "padding": "0",
        "length": "10",
        "input": {
            "type": "replaceAll",
            "attributes": {
                "table": {
                    "[a-zA-z]": ""
                }
            }
        },
    }
    "type": "leftPad",
    "name": "Left Pad Transform"
}
3 Likes

There is a small typo in the code snippet u provided, type-name properties should be outside of attributes. But u are right regarding the input, that worked out.

1 Like

you’re right, thanks! i’ve updated my comment to reflect that :slight_smile:

1 Like

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