Update of Email with added value when account goes inactive

When we have a user go inactive their email has to stay on the identity profile and added a X at the end of the email address, so it’s not used.

I have it working for active but in reverse the email is showing but nothing at the end as i have in my code. Still learning the velocity method and if i can get a 2nd eye on this i would be grateful. I see to figure it out later on but maybe someone can be quicker so i can close this out for the week.

{
“id”: “”,
“name”: “Non-employee email Transform”,
“type”: “static”,
“attributes”: {
“ignoreErrors”: “true”,
“value”: “#if($status==‘inactive’)email+X#{else}$email#end”,
“status”: {
“type”: “accountAttribute”,
“attributes”: {
“attributeName”: “userAccountControl”,
“sourceName”: “ACTIVE DIRECTORY NON-EMPLOYEE ACCOUNT SOURCE”
}
},
“email”: {
“type”: “accountAttribute”,
“attributes”: {
“attributeName”: “mail”,
“sourceName”: " ACTIVE DIRECTORY NON-EMPLOYEE ACCOUNT SOURCE"
}
}
},
“internal”: false
}

“value”: “#if($status==‘inactive’)email+‘X’#{else}$email#end”,

Add ‘’ arround your X

and also $email :

“value”: “#if($status==‘inactive’)$email+‘X’#{else}$email#end”,

Hi @VBsupport,

This works for me :

"value": "#if($status=='inactive')${email}X#{else}$email#end"

1 Like

I’m agree with @jesvin90

I added the updated value and the email stays for an inactive but is not appending the “X” after their name. I swear this system hates me this week

Hi @VBsupport,

userAccountControl value does not come as active/inactive

Check the below article for details. You will need to modify the transform accordingly.

So this is working for my manager. The UAC is being transformed into inactive or active on what ad has in that field which is 514 for disabled. Maybe i can reference the identity state instead directly

I changed the UAC to an identity attribute reference and mapped status.

{

"name": "Non-employee email Transform",
"type": "static",
"attributes": {
    "ignoreErrors": "true",
    "value": "#if($status=='inactive')$email X#{else}$email#end",
    "status": {
        "type": "identityAttribute",
        "attributes": {
            "name": "status"
        }
    },
    "email": {
        "type": "accountAttribute",
        "attributes": {
            "attributeName": "mail",
            "sourceName": "ACTIVE DIRECTORY NON-EMPLOYEE ACCOUNT SOURCE"
        }
    }
},
"internal": false

}

Hope it help anyone out there and thanks everyone for the 2nd and 3rd eyes

Hi @VBsupport,

You should consider using Identity attribute context as below :

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