To find length of a string

Hi,

Can someone please let me know on how to check the length of an attribute string.

example Attribute:

"DepartmentName": {
                "attributes": {
                    "attributeName": "Department",
                    "sourceName": "Workday"
                },
                "type": "accountAttribute"
            },

input :
Department = Science,

output :
length = 6

The static operation uses Velocity Template Language (VTL), which is quite a powerful tool in extending the functionality of your transforms. This means you can use standard Java functions on data types like strings. In your case, returning the length of a string attribute is as simple as the following transform:

{
    "attributes": {
        "name": {
            "attributes": {
                "attributeName": "name",
                "sourceName": "Employees"
            },
            "type": "accountAttribute"
        },
        "value": "$name.length()"
    },
    "name": "Attribute Length",
    "type": "static"
}

input: adam.archer
output: 11

1 Like