Hello everyone,
I’ve created a transform to build a mobile number. The transform is working fine.
mobile: +491753014148, +49175, +49 etc,
but we need to introduce the space in between conditionally as per the value existence as below?
+49 175 3014148, +49 175, +49
{
"name": "MobileNumber",
"type": "e164phone",
"attributes": {
"input": {
"attributes": {
"MOBI_AREA": {
"attributes": {
"ignoreErrors": true,
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "*****",
"attributeName": "MOBI_AREA"
}
},
"None"
]
},
"type": "firstValid"
},
"MOBI_VORW": {
"attributes": {
"ignoreErrors": true,
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "*****",
"attributeName": "MOBI_VORW"
}
},
"None"
]
},
"type": "firstValid"
},
"MOBI_TELN": {
"attributes": {
"ignoreErrors": true,
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "*****",
"attributeName": "MOBI_TELN"
}
},
"None"
]
},
"type": "firstValid"
},
"MOBI_EXTN": {
"attributes": {
"ignoreErrors": true,
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "*****",
"attributeName": "MOBI_EXTN"
}
},
"None"
]
},
"type": "firstValid"
},
"default": {
"type": "static",
"attributes": {
"value": ""
}
},
"value": "#if($MOBI_VORW !='None' && $MOBI_TELN !='None' && $MOBI_EXTN !='None')$MOBI_VORW$MOBI_TELN$MOBI_EXTN#{elseif} ($MOBI_VORW !='None' && $MOBI_TELN !='None')$MOBI_VORW$MOBI_TELN#{elseif} ($MOBI_VORW !='None')$MOBI_VORW#{else}$default#end"
},
"type": "static"
},
"defaultRegion": {
"type": "lookup",
"attributes": {
"table": {
"1": "US",
"7": "RU",
"20": "EG",
"27": "ZA",
"30": "GR",
"31": "NL",
"32": "BE",
"33": "FR",
"34": "ES",
"36": "HU",
"39": "IT",
"211": "SS",
"212": "EH",
"213": "DZ",
"216": "TN",
"1-684": "AS",
"1-264": "AI",
"1-268": "AG",
"1-242": "BS",
"1-246": "BB",
"1-441": "BM",
"44-1481": "GG",
"44-1624": "IM",
"1-876": "JM",
"44-1534": "JE",
"1-664": "MS",
"1-670": "MP",
"1-787": "PR",
"default": "US"
},
"input": {
"type": "accountAttribute",
"attributes": {
"sourceName": "*****",
"attributeName": "MOBI_AREA"
}
}
}
}
},
"internal": false
}