Email Attribute Transform

Hi All,
I have written a transform for identity profile that checks if the mail attribute in the active directory account is null if yes then it applies a static value else it takes the mail attribute from the active directory account and update it to the identity profile but it is showing error.
My question is if i use this transform and a user does not have an active directory account yet will it still work?
Because that’s what i am currently doing

Below is the transform:

{
  "attributes": {
    "expression": "$mail eq null",
    "positiveCondition": "$dummyEmail",
    "negativeCondition": "$adEmailUpdate",
    "mail": {
      "attributes": {
        "sourceName": "Deepanshu Active Directory",
        "attributeName": "mail"
      },
      "type": "accountAttribute"
    },
    "dummyEmail": {
      "attributes": {
        "value": "[email protected]"
      },
      "type": "static"
    },
    "adEmailUpdate": {
  "attributes": {
    "attributeName": "mail",
    "sourceName": "Deepanshu Active Directory",
    "accountSortAttribute": "created",
    "accountSortDescending": true,
    "accountReturnFirstLink": true
  },
  "type": "accountAttribute",
  "name": "Account Attribute Transform"
}
  },
  "type": "conditional",
  "name": "Deepanshu Conditional Transform"
}

Hi @DeepanshuBisht

The conditional transform does not allow null to be one of the operands.
Please refer this document

This is where you can use the “firstValid” transform type. The hardcoded mail value—in my example, “[email protected]”—will be returned if the mail from the Active Directory application is null.

{
  "attributes": {
    "values": [
      {
        "attributes": {
          "sourceName": "Active Directory",
          "attributeName": "mail"
        },
        "type": "accountAttribute"
      },
      "[email protected]"
    ]
  },
  "type": "firstValid",
  "name": "Test First Valid Transform"
}

1 Like

Thanks abhinav that’s an efficient way to do this although the one I wrote using conditional transform also worked.

1 Like

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