Transform exception - detecting title change

There was an exception while calculating the value for this attribute. Error rendering template: #if($existingTitle != 'empty' && $newTitle != 'empty' && existingTitle != $(newTitle) && $titleChange != $(todaysDate))$todaysDate#end

I only want to write data if all of the conditions are met. The use case is to have a searchable identity attribute to detect when the title changes. It should write out today’s date MM/dd/yyyy.

Below is the full transform. Does VLT have a limit as to the number of evaluations it can calculate? I think my todaysDate logic looks right. I believe I have handled all null conditions.

{
    "id": "92db54dc-8e95-4af4-8a03-6f9dad5b1d4f",
    "name": "SB-Title Change Date-TST",
    "type": "static",
    "attributes": {
        "newTitle": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "attributeName": "JOBTITLE",
                            "sourceName": "TST"
                        },
                        "type": "accountAttribute"
                    },
                    {
                        "attributes": {
                            "value": "empty"
                        },
                        "type": "static"
                    }
                ]
            },
            "type": "firstValid"
        },
        "existingTitle": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "name": "title"
                        },
                        "type": "identityAttribute"
                    },
                    {
                        "attributes": {
                            "value": "empty"
                        },
                        "type": "static"
                    }
                ]
            },
            "type": "firstValid",
            "ignoreErrors": "true"
        },
        "titleChange": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "name": "titleChangeDate"
                        },
                        "type": "identityAttribute"
                    },
                    {
                        "attributes": {
                            "value": "empty"
                        },
                        "type": "static"
                    }
                ]
            },
            "type": "firstValid",
            "ignoreErrors": "true"
        },
        "todaysDate": {
            "attributes": {
                "inputFormat": "yyyy-MM-dd'T'HH:mm:ss.SSSZ",
                "outputFormat": "MM/dd/yyyy",
                "input": {
                    "attributes": {
                        "input": "",
                        "expression": "now",
                        "roundUp": false
                    },
                    "type": "dateMath"
                }
            },
            "type": "dateFormat"
        },
        "value": "#if($existingTitle != 'empty' && $newTitle != 'empty' && existingTitle != $newTitle && $titleChange != $todaysDate)$todaysDate#end"
    },
    "internal": false
}

I fixed the exception, missing the $ on a variable…

Currently it doesn’t look to be populating a value.

Question: When the data is being aggregated, are some attributes transformed and written prior to other attributes? Could it be updating the title in IDN on a different transform prior to this transform running, where it is only writing a date if it sees a difference in IDN and the source data? Am I able to handle this in a transform or must I use a rule?

You should avoid using an Identity attribute for calculation within other transforms as they may not be evaluated accurately. Only LCS attribute is evaluated last but others could be in any sequence.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.