Hello,
I have an error on a transform. I tried to wrote it in two different ways
As a concat transform
{
"id": "29f31d53-1c4e-4933-86d9-f84b479eff22",
"name": "Transform - Calculate AD Tier2 UPN",
"type": "concat",
"attributes": {
"values": [
{
"type": "static",
"attributes": {
"value": "$identity.getStringAttribute('firstname')"
}
},
".",
{
"type": "static",
"attributes": {
"value": "$identity.getStringAttribute('lastname')"
}
},
"@",
{
"attributes": {
"personType": {
"type": "static",
"attributes": {
"value": "$identity.getStringAttribute('personType')"
}
},
"value": "#if($personType=='Regular') #set($domainPrefix = '') #else #set($domainPrefix = 'external.') #end $domainPrefix"
},
"type": "static"
},
{
"attributes": {
"legalEmployerAlias": {
"type": "static",
"attributes": {
"value": "$identity.getStringAttribute('legalEmployerAlias')"
}
},
"value": "#if($legalEmployerAlias=='CAAB') #set($domain = 'ca-autobank') #else #set($domain = 'drivalia') #end $domain"
},
"type": "static"
},
".com"
]
},
"internal": false
}
and as a static one
{
"name": "Static Transform - Calculate AD Tier2 UPN",
"type": "static",
"attributes": {
"firstName": {
"attributes": {
"value": "$identity.getStringAttribute('firstname')"
},
"type": "static"
},
"lastname": {
"attributes": {
"value": "$identity.getStringAttribute('lastname')"
},
"type": "static"
},
"personType": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "identityAttribute",
"attributes": {
"attributeName": "personType"
}
},
"-"
]}},
"legalEmployerAlias": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "identityAttribute",
"attributes": {
"attributeName": "legalEmployerAlias"
}
},
"-"
]}},
"value": "#if($personType=='Regular') #set($domainPrefix = '') #else #set($domainPrefix = 'external.') #end #if($legalEmployerAlias=='CAAB') #set($domain = 'ca-autobank') #else #set($domain = 'drivalia') #end $firstName.$lastname@$domainPrefixdomain.com"
},
"internal": false
}
The error I get is the following:
There was an exception while calculating the value for this attribute. Error during transformation for attribute: adUpn (Transform ID: Static Transform - Calculate AD Tier2 UPN) Cause: Error rendering template: #if($personType=='Regular') #set($domainPrefix = '') #else #set($domainPrefix = 'external.') #end #if($legalEmployerAlias=='CAAB') #set($domain = 'ca-autobank') #else #set($domain = 'drivalia') #end $firstName.$lastname@$domainPrefixdomain.com
Can you help me? Thanks in advance