How to get beginning of a dynamic string? (IDN Transform question)

I’m looking for a way to get a substring of an account attribute via a transform. The value I’m looking to get is everything before the last 6 characters of the string. Any suggestions would be greatly appreciated!

Solved: https://community.sailpoint.com/t5/IdentityNow-Forum/Department-Transform/td-p/31627

For this use case, you likely want to use a ‘substring’.

substring

Extracts a part of the input string.

Attributes:

begin - The index of the first part of the substring. If begin is -1, the substring will start at 0.

beginOffset - The offset to add to the begin index. This offset is only added if begin is not -1.

end - The index of the last part of the substring. If end is -1, the substring will end at the end of the input string.

endOffset - The offset to add to the end index. This offset is only added if end is not -1.

Your transform may look something like this:

{

  "id": "TruncateDepartment",

  "type": "substring",

  "attributes": {

    "begin": 6,

    "end": -1,

    "input": {

      "type": "accountAttribute",

      "attributes": {

        "sourceName": "Workday",

        "attributeName": "Department"

      }

    }

  }

}

This would take the value of ‘Department’ attribute on a source called ‘Workday’ from ‘12345 Finance’ to ‘Finance’. This assumes that the number is a fixed length (5 chars).

1 Like