Bernardc
(Bernard Chiew)
February 25, 2026, 8:46am
1
Hi Sailors,
Below is my transform to determine when a comma is needed, but its pop error, wonder which part of my transform is incorrect.
Expected result:
If both value from JDBC’s USERTYPE and HR Source USERTYPE is not null, the result should be: Value1,Value
{
"name": "Transform for businessCategory value V5",
"type": "static",
"attributes": {
"arType": {
"type": "accountAttribute",
"attributes": {
"sourceName": "JDBC",
"attributeName": "USER_TYPE"
}
},
"hrType": {
"type": "accountAttribute",
"attributes": {
"sourceName": "HR Source",
"attributeName": "USER_TYPE"
}
},
"value": "#if($arType!=null && $hrType!=null)$arType,$hrType#elseif($arType!=null)$arType#elseif($hrType!=null)$hrType#else\"\"#end"
}
}
Tulasi
(Tulasi Sowjanya Pallaprolu)
February 25, 2026, 10:05am
2
Hi @Bernardc
can you try this
“value”: “#if ($arType && $hrType)$arType,$hrType#elseif($arType)$arType#elseif($hrType)$hrType#else\”\“#end ”
I tried it from my end and it worked fine
Thanks & reagrds
Tulasi
Bernardc
(Bernard Chiew)
February 25, 2026, 10:38am
3
Looks like cannot have $variiable!=null in the value
sanatar
(SathishKumar N)
February 25, 2026, 10:50am
4
Hi
Give a try with the below code
“value”: “#if ($arType && $arType != ‘’ && $hrType && $hrType != ‘’)$arType,$hrType#elseif($arType && $arType != ‘’)$arType#elseif($hrType && $hrType != ‘’)$hrType#else""#end ”
Regards
SathishKumar N
Tulasi
(Tulasi Sowjanya Pallaprolu)
February 25, 2026, 10:51am
5
Correct. maybe The Velocity template does not support direct comparisons to null in its syntax
baoussounda
(Ousmane N'DIAYE)
February 25, 2026, 11:17am
6
You can try also and make sure that attributes mentionned are present in your account schemas :
{
"name": "Transform for businessCategory value V5",
"type": "static",
"attributes": {
"arType": {
"type": "accountAttribute",
"attributes": {
"sourceName": "JDBC",
"attributeName": "USER_TYPE"
}
},
"hrType": {
"type": "accountAttribute",
"attributes": {
"sourceName": "HR Source",
"attributeName": "USER_TYPE"
}
},
"value": "#if($arType && $hrType)$arType,$hrType#elseif($arType)$arType#elseif($hrType)$hrType#else#end"
}
}
j_place
(Jeremy Place)
February 25, 2026, 12:02pm
7
Hi @Bernardc With any kind of NULL comparison, it’s best to wrap your attribute values in a firstValid transform with it returning a static value of, say, “NULL” if the attribute value is not found. That way your IF becomes a simple if not (a="NULL" or b="NULL") (that’s pseudo code not velocity template)