Account Attribute Transform

Hi Everyone, I am stuck in one of my transform which is causing issues, I need to remove few special umlaut character from my firstname and lastname and end result should be in lower case and if we have any double words in firstname or in lastname it should replace with -

Here is my transform

{
    "id": "f20f49c6-9c0a-4445-918c-cea63dba905f",
    "name": "Transformed:LName",
    "type": "lower",
    "attributes": {
        "type": "replaceAll",
        "attributes": {
            "type": "accountAttribute",
            "attributes": {
                "sourceName": "DemoSource",
                "attributeName": "LastName"
            },
            "table": {
                "ä": "ae",
                "ö": "oe",
                "ü": "ue",
                "ß": "ss",
                " ": "-"
            }
        }
    },
    "internal": false
}

It is not able to format clearly, I had tried to use with explicit input too but I got error on calculating value, I am not sure why it is not able to calculate the values

Please try to use this

{
    "id": "f20f49c6-9c0a-4445-918c-cea63dba905f",
    "name": "Transformed:LName",
    "type": "lower",
    "attributes": {
		"input": {		
			"type": "replaceAll",
			"attributes": {
				"input": {
					"type": "accountAttribute",
					"attributes": {
						"sourceName": "DemoSource",
						"attributeName": "LastName"
					}
				},
				"table": {
					"ä": "ae",
					"ö": "oe",
					"ü": "ue",
					"ß": "ss",
					" ": "-"
				}
			}
		}
    },
    "internal": false
}

You can also try to use Decompose Diacritial Marks and Name Normalizer transforms in combination with the above.

Hi @LearningStar , You can try below transform

{
    "id": "f20f49c6-9c0a-4445-918c-cea63dba905f",
    "name": "Transformed:Name",
    "type": "replaceAll",
    "attributes": {
        "type": "accountAttribute",
        "attributes": {
            "sourceName": "DemoSource",
            "attributeName": "FirstName"
        },
        "table": {
            "Ä": "ae",
            "ä": "ae",
            "Ö": "oe",
            "ö": "oe",
            "Ü": "ue",
            "ü": "ue",
            "ß": "ss"
        },
        "lower": true
    },
    "internal": false
}
Thank you .

1 Like

Unfortunately, that doesn’t work, it still showing me failed error

There was an exception while calculating the value for this attribute. Error during transformation for attribute: simplifiedlastname (Transform ID: UmlautLname) Cause: An empty regex expression may not be used for target value:

I believe you need to replace this line with unicode for space character and try this :-

"\u0020": "-"

Hey @sharvari :Thanks a lot for suggesting way to handle spaces, Error got resolved but actual last name still showing space between double words instead of - , I feel it’s not able to interpret it correctly, if it can use - whenever it encounters space between them, we should be good

"\s": "-"

Did you try using \s ?

Hey I tried “\s” : “-” , It worked for this transform. Thanks @sharvari

I mean double \s with ‘s’ then it worked but with single \s it was not accepting