Date Compare transform

Hello Experts,
I have created below DataCompare Transform. But getting the null error

I am comparing ADLastLogOn+50 days with today.

If ADLastLogOn+50 days is less than or equals to today.
Could anybody tell me what am I doing wrong here?

{
    "id": "",
    "name": "Test-DateCompare",
    "type": "dateCompare",
    "attributes": {
        "firstDate": {
            "type": "dateMath",
            "attributes": {
                "expression": "+50d",
                "roundUp": false,
                "input": {
                    "type": "dateFormat",
                    "attributes": {
                        "inputFormat": "yyyy-MM-dd",
                        "outputFormat": "ISO8601",
                        "input": {
                            "attributes": {
                                "name": "adLastLogon"
                            },
                            "type": "identityAttribute"
                        }
                    }
                }
            }
        },
        "secondDate": {
            "type": "dateMath",
            "attributes": {
                "expression": "now",
                "roundUp": false
            },
            "operator": "lte",
            "positiveCondition": "yes",
            "negativeCondition": "No"
        }
    },
    "internal": false
}

Here is an example of a date compare. I think the part you are missing is formatting the second date. The values when you compare them need to be in the same format.

{
    "id": "REMOVED",
    "name": "DateCompare - HireDate to TermDate",
    "type": "dateCompare",
    "attributes": {
        "firstDate": {
            "attributes": {
                "input": {
                    "attributes": {
                        "values": [
                            {
                                "attributes": {
                                    "sourceName": "Workday Production Sandbox",
                                    "attributeName": "Hire Date__c"
                                },
                                "type": "accountAttribute"
                            },
                            {
                                "attributes": {
                                    "sourceName": "Workday Sandbox",
                                    "attributeName": "Hire Date__c"
                                },
                                "type": "accountAttribute"
                            },
                            "2021-08-06"
                        ]
                    },
                    "type": "firstValid"
                },
                "inputFormat": "yyyy-MM-dd",
                "outputFormat": "ISO8601"
            },
            "type": "dateFormat"
        },
        "secondDate": {
            "attributes": {
                "input": {
                    "attributes": {
                        "values": [
                            {
                                "attributes": {
                                    "sourceName": "Workday Production Sandbox",
                                    "attributeName": "Term Date__c"
                                },
                                "type": "accountAttribute"
                            },
                            {
                                "attributes": {
                                    "sourceName": "Workday Sandbox",
                                    "attributeName": "Term Date__c"
                                },
                                "type": "accountAttribute"
                            },
                            "1900-08-07"
                        ]
                    },
                    "type": "firstValid"
                },
                "inputFormat": "yyyy-MM-dd",
                "outputFormat": "ISO8601"
            },
            "type": "dateFormat"
        },
        "operator": "GTE",
        "positiveCondition": "active",
        "negativeCondition": "terminate"
    },
    "internal": false
}

I believe it’s a duplicate post : Date Compare transform

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