Hello,
I am working on a transform that when a user is in more then 1 HR source and one of the accounts is disabled to populate the correct email value. This value is used for attribute sync so my goal is to accurately show the primary email of the user. This is my first time writing a complex transform and want to make sure that I am thinking about this logic correctly. Any pointers on the below logic?
{
"name": "findEmail",
"type": "firstValid",
"attributes": {
"ADEmail":{
"values":[
{
"attributes": {
"attributeName": "mail",
"sourceName": "Active Directory"
},
"type": "accountAttribute"
}
]
},
"workDayEmail":{
"values": [
{
"attributes": {
"attributeName": "EMAIL_ADDRESS_WORK",
"sourceName": "Workday Sandbox"
},
"type": "accountAttribute"
}
]
},
"secZettaEmail":{
"values":[
{
"attributes": {
"attributeName": "personal_email",
"sourceName": "SecZetta"
},
"type": "accountAttribute"
}
]
},
"SNEmail":{
"values":[
{
"attributes": {
"attributeName": "email",
"sourceName": "ServiceNow - SSMHCTEST"
},
"type": "accountAttribute"
}
]
},
"noEmail":{
"values":[
{
"attributes": {
"value": "[email protected]"
},
"type": "static"
}
]
},
"value": #if($workdayStatus == true)$secZettaEmail#elseif($workdayStatus == false)$workdayEmail#elseif($ADEmail != null)$ADEmail#elseif($SNEmail != null)$SNEmail#{else}$noEmail#end
},
"internal": false
}