Hi All,
I just wanted to know that, whether we can use Username Generator transform inside any other transform like Conditional/static/firstValid, as we have an requirement to populate a static value and usernameGenerator value to the distinguished name based on condition, static value in the positive condition is getting populated correctly , however in the negative condition unique counter is not working in the username generator(kept usernameGenerator in negative condition).
Any suggestions would be highly appreciated.
Hi @ShireeshaC2024,
Yes we can do that. Username Generator is more likely to be used in create account profile while provisioning account where you can use conditional transform for taking decision.
-Vasanth
Hi @vasanthrajsp29
Thanks for the reply,
I have developed a custom transform by including the usernamegenerator transform in the negative condition the problem with the transform is positive condition is working fine, but when comes to the negative condition unique counter is not working, tried creating users with same firstname and last name where it should check for uniquness and append numbers if already found, that is not working, giving the error as entry already exists. Can you please review the transform and let me know what I am missing here.
{
“name”: “distinguishedName”,
“transform”: {
“type”: “conditional”,
“attributes”: {
“expression”: “$reh eq 1”,
“reh”: {
“type”: “firstValid”,
“attributes”: {
“values”: [
{
“attributes”: {
“name”: “rehire”
},
“type”: “identityAttribute”
},
{
“attributes”: {
“value”: “NA”
},
“type”: “static”
}
]
}
},
“username”: {
“type”: “firstValid”,
“attributes”: {
“values”: [
{
“attributes”: {
“name”: “adUsername”
},
“type”: “identityAttribute”
},
{
“attributes”: {
“value”: “NA”
},
“type”: “static”
}
]
}
},
“ou”: {
“type”: “lookup”,
“attributes”: {
“input”: {
“attributes”: {
“name”: “businessUnitCode”
},
“type”: “identityAttribute”
},
“table”: {
“CU001”: “OU=xyz,OU=xyz”,
“SS001”: “OU=xyz”,
“HBA01”: “OU=xyz”,
“DM001”: “OU=xyz”,
“SL001”: “OU=xyz”,
“STRYR”: “OU=xyz,OU=xyz”,
“SEI01”: “OU=xyz”,
“JRS01”: “OU=xyz”,
“default”: “OU=xyz”
}
}
},
“positiveCondition”: {
“type”: “static”,
“attributes”: {
“value”: “CN=$username,$ou,DC=xx,DC=xx”
}
},
“negativeCondition”: {
“type”: “usernameGenerator”,
“attributes”: {
“sourceCheck”: true,
“patterns”: [
“CN=$fi.$ln,$ou,DC=xx,DC=xx”,
“CN=$fi.$ln${uniqueCounter},$ou,DC=xx,DC=xx”
],
“fi”: {
“attributes”: {
“begin”: 0,
“end”: 1,
“input”: {
“attributes”: {
“name”: “firstNameFormatted”
},
“type”: “identityAttribute”
}
},
“type”: “substring”
},
“ln”: {
“type”: “identityAttribute”,
“attributes”: {
“name”: “lastNameFormatted”
}
},
“ou”: {
“type”: “lookup”,
“attributes”: {
“input”: {
“attributes”: {
“name”: “businessUnitCode”
},
“type”: “identityAttribute”
},
“table”: {
“CU001”: “OU=XXXX,OU=XXXX”,
“SS001”: “OU=xyz”,
“HBA01”: “OU=XXXX”,
“DM001”: “OU=xyz”,
“SL001”: “OU=xyz”,
“STRYR”: “OU=xyz,OU=xyz”,
“SEI01”: “OU=xyz”,
“JRS01”: “OU=xyz”,
“default”: “OU=xyz”
}
}
}
}
}
}
},
“attributes”: {
“cloudMaxUniqueChecks”: “100”,
“cloudMaxSize”: “100”,
“cloudRequired”: “true”
},
“isRequired”: false,
“type”: “usernameGenerator”,
“isMultiValued”: false
},