I built a Transform recently that references the $identity object. (See below for logic).
The transform is able to loop through the user’s “memberOf” values for our Active Directory Source, and display the values in a comma separated list using the following Code:
#foreach($link in $identity.getLinksByAppIdOrName(\"72c124f46eb946879e28a63acc8cf559\",null))#if($foreach.index + 1 != $identity.getLinks().size())$link.getAttribute(\"memberOf\")(),#else$link.getAttribute(\"memberOf\")#end#end
I have seen Posts that claim it is not possible to reference multi value attributes in a Transform, but using the method it looks like this is incorrect.
I do not see any documentation where SailPoint mentions that a Transform can access the “$identity” Object, and there are no examples like the ones shown below in official SailPoint Documentation. Community posts like the one below, however, show that this can be done.
My Questions are:
- “Should I be careful using this method to pull data from Multi Value Attributes? Is there any chance SailPoint will pull support for this type Transform? I am concerned that I will start using this in several of my Transforms and SailPoint will later remove this functionality - seeing as it doesn’t seem to be documented anywhere.”
- Is there SailPoint documentation somewhere out there that I’m missing which describes how the “$identity” Object can be used in a transform?
Example Transform:
{
"name": "P1EntitlementExists_Transform",
"type": "static",
"requiresPeriodicRefresh": true,
"attributes": {
"memOfList": {
"attributes": {
"values": [
{
"attributes": {
"value": "#foreach($link in $identity.getLinksByAppIdOrName(\"72c124f46eb946879e28a63acc8cf559\",null))#if($foreach.index + 1 != $identity.getLinks().size())$link.getAttribute(\"memberOf\")(),#else$link.getAttribute(\"memberOf\")#end#end"
},
"type": "static"
},
"None"
]
},
"type": "firstValid"
},
"hasprivad": {
"attributes": {
"values": [
{
"attributes": {
"sourceName": "Active Directory - Privileged Accounts",
"attributeName": "description"
},
"type": "accountAttribute"
},
"none"
]
},
"type": "firstValid"
},
"value": "#if($hasprivad == 'none')na#{elseif}($memOfList == '[CN=Domain Users,CN=Users,DC=COXINC,DC=com](),' && $hasprivad == 'Managed by SailPoint - PRIV')false#{elseif}($memOfList != '[CN=Domain Users,CN=Users,DC=COXINC,DC=com](),' && $hasprivad == 'Managed by SailPoint - PRIV')true#{else}none#end"
},
"internal": false
}