I am working on a requirement in IdentityNow where I need to check if a specific attribute (userTermDate) has a value.
If the attribute has a value, the result should be true.
If the attribute is empty/null, the result should be false.
I have drafted a Static Transform using firstValid to handle nulls and a Velocity #if statement for the logic. I’d like to get some feedback on whether this is the most robust way to handle this, or if there are better ways to handle empty strings versus nulls.
{
"name": "TRF_HasTermDate_Troyv1",
"type": "static",
"attributes": {
"hasTermDate": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "workday test",
"attributeName": "userTermDate"
}
},
"empty"
],
"ignoreErrors": false
}
},
"value": "#if($hasTermDate=='empty')false#{else}true#end"
},
"internal": false
}
tried to check the result in identity profile mappings preview, even though the identity has a userTermDate value, it still give false value to my Has Term Date attribute.
Any advice or improvements would be greatly appreciated!