Split transform use case on identity profile

I am getting multiple approver values stored in single attribute from AD and I want to split the first two values and store in 2 separate identity attribute, first one is the primary approver and second one is secondary approver stored in the AD attribute. The values are divided via “;” and the values are the employee ID of the approvers. Not all entries in this attribute have multiple value, a lot of them has only 1 value so there will be cases when there is no “;” for split. Are there any reference transforms where we can first split the values of the approvers and then search the display name attribute so that for end users display name is displayed in the secondary approver identity attribute?

You can specify optional attribute throws to false, so you get null as second approver if you don’t have in AD attribute.

You can look into Get Reference Identity Attribute Transform to get display name.

Thanks
Krish

3 Likes

Give this transform a try:

{
    "name": "First Approver",
    "type": "rule",
    "attributes": {
        "attributeName": "displayName",
        "name": "Cloud Services Deployment Utility",
        "operation": "getReferenceIdentityAttribute",
        "uid": {
            "type": "static",
            "attributes": {
                "approver": {
                    "attributes": {
                        "values": [
                            {
                                "attributes": {
                                    "input": {
                                        "attributes": {
											"attributeName": "AttributeName",
											"sourceName": "Active Directory"
										},
										"type": "accountAttribute"
									},
                                    "delimiter": ";",
                                    "index": 0,
                                    "throws": false
                                },
                                "type": "split"
                            },
                            "NONE"
                        ]
                    },
                    "type": "firstValid"
                },
                "value": "#if($approver != 'NONE')$approver#end"
            }
        }
    },
}

To get the second approver name, change the index to 1 within the split transform.

This should get you the display name of both approvers in separate identity attributes.

4 Likes

@sharvari
Here you are passing employeeID as uid which will work only when employeeID is set as Identity Attribute uid right?

1 Like

Yes, that is correct.

1 Like

Thanks for sharing a reference transform! It works :slightly_smiling_face:

1 Like

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