Issue with FirstValid Transform

Hi,

I am trying to write a lifecycle state transform for workday source.

For the lifecycle state as Inactive , trying to write a transform on TERMINATION_DATE . While using the firstValid transform as not all the Identities have TERMINATION_DATE value, getting below error:

There was an exception while calculating the value for this attribute. java.time.format.DateTimeParseException: Text ‘{attributes={input=com.sailpoint.seaspray.transform.FirstValidTr…’ could not be parsed at index 0

Transform is as below:

{
    "name": "Determine Workday LCS",
    "type": "static",
    "attributes": {
        "requiresPeriodicRefresh": "true",
        "activestate": {
            "attributes": {
                "firstDate": "now",
                "secondDate": {
                    "attributes": {
                        "input": {
                            "type": "accountAttribute",
                            "attributes": {
                                "attributeName": "HIREDATE",
                                "sourceName": "WorkDay_Test"
                            }
                        },
                        "inputFormat": "MM/dd/yyyy",
                        "outputFormat": "ISO8601"
                    },
                    "type": "dateFormat"
                },
                "operator": "GTE",
                "positiveCondition": "yes",
                "negativeCondition": "no"
            },
            "type": "dateCompare"
        },
        "prehire": {
            "attributes": {
                "firstDate": {
                    "attributes": {
                        "expression": "now+45d/d",
                        "roundUp": false
                    },
                    "type": "dateMath"
                },
                "secondDate": {
                    "attributes": {
                        "input": {
                            "type": "accountAttribute",
                            "attributes": {
                                "attributeName": "HIREDATE",
                                "sourceName": "WorkDay_Test"
                            }
                        },
                        "inputFormat": "MM/dd/yyyy",
                        "outputFormat": "ISO8601"
                    },
                    "type": "dateFormat"
                },
                "operator": "GTE",
                "positiveCondition": "yes",
                "negativeCondition": "no"
            },
            "type": "dateCompare"
        },
        "onleave": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "attributeName": "ON_LEAVE",
                            "sourceName": "WorkDay_Test"
                        },
                        "type": "accountAttribute"
                    },
                    {
                        "attributes": {
                            "value": "none"
                        },
                        "type": "static"
                    }
                ]
            },
            "type": "firstValid"
        },
        "inactivestate": {
            "attributes": {
                "negativeCondition": "no",
                "positiveCondition": "yes",
                "firstDate": "now",
                "operator": "GT",
                "secondDate": {
                    "attributes": {
                        "input": {
                            "attributes": {
                                "values": [
                                    {
                                        "attributes": {
                                            "input": {
                                                "attributes": {
                                                    "attributeName": "TERMINATION_DATE",
                                                    "sourceName": "WorkDay_Test"
                                                },
                                                "type": "accountAttribute"
                                            },
                                            "inputFormat": "MM/dd/yyyy",
                                            "outputFormat": "ISO8601"
                                        },
                                        "type": "dateFormat"
                                    },
                                   "NA" 
                                ],
                                "ignoreErrors": "true"
                            },
                            "type": "firstValid"
                        }
                    }
                }
            },
            "type": "dateCompare"
        },
        "value": "#if(($inactivestate == 'no' || $inactivestate != 'NA') && $activestate == 'yes' && ($onleave == 'none' || $onleave == '0'))active#elseif($activestate == 'no' && $prehire == 'yes' && $onleave != '1')prehire#elseif($onleave == '1')leaveOfAbsence#elseif($inactivestate == 'yes')inactive#{else}UNKNOWN#end"
    }
}

Please help to resolve this asap.

The issue might be that you are trying to perform a dateFormat on an attribute that might be null, hence the exception error you are getting. Try running firstValid on your TERMINATION_DATE without the dateFormat. Then run a conditional that will return the formatted date IF the TERMINATION_DATE is not NA, else it will return NA.