Following KB describe building transformation for identity attribute.
Following example present how to populate 'mail' attribute from HR resource as first option and if null than from AD mail attribute.
example for transformation rule:
{
"name": "CUSTOMER_NAME-Set Email",
"type": "firstValid",
"attributes": {
"values": [
{
"attributes": {
"sourceName": "HR-Hilan",
"attributeName": "mail"
},
"type": "accountAttribute"
},
{
"attributes": {
"sourceName": "Active Directory - SB",
"attributeName": "mail"
},
"type": "accountAttribute"
},
{
"attributes": {
"value": ""
},
"type": "static"
}
],
"ignoreErrors": false
}
}
how to set it in the Identity profile: