# DateCompare transform failing with firstDate null when using accountAttribute from source Employee

**URL:** <https://developer.sailpoint.com/discuss/t/datecompare-transform-failing-with-firstdate-null-when-using-accountattribute-from-source-employee/211983>\
**Category:** SHF Discussion and Questions\
**Tags:** sailpoint-identity-security\
**Created:** [June 8, 2026, 8:06pm UTC](https://developer.sailpoint.com/discuss/t/datecompare-transform-failing-with-firstdate-null-when-using-accountattribute-from-source-employee/211983 "2026-06-08T20:06:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![henriqueoliveira2026](https://avatars.discourse-cdn.com/v4/letter/h/b38774/32.png) [@henriqueoliveira2026](https://developer.sailpoint.com/discuss/u/henriqueoliveira2026)\
**Post date:** [June 8, 2026, 8:06pm UTC](https://developer.sailpoint.com/discuss/t/datecompare-transform-failing-with-firstdate-null-when-using-accountattribute-from-source-employee/211983/1 "2026-06-08T20:06:41Z")

</div>

Hello SailPoint Support,

We are facing an issue with an Identity Security Cloud transform used to calculate the Lifecycle State for contractor identities.

The transform is a static transform that uses two nested dateCompare transforms. Both dateCompare blocks read the same account attribute from the authoritative source “Terceiros”, attribute “endDate”.

However, during identity refresh, some identities are failing with the following error:

java.lang.IllegalArgumentException: DateCompare failed: both firstDate and secondDate must be provided. Current values: firstDate[null], secondDate[2026-05-01T00:00Z]

> The error indicates that firstDate is being resolved as null, even though the transform is configured to read the account attribute Terceiros.endDate.
> 
> `"type": "static",`  
> ` "attributes": {`  
> ` "isActive": {`  
> ` "type": "dateCompare",`  
> ` "attributes": {`  
> ` "firstDate": {`  
> ` "attributes": {`  
> ` "sourceName": "Terceiros",`  
> ` "attributeName": "endDate"`  
> ` },`  
> ` "inputFormat": "ISO8601",`  
> ` "outputFormat": "ISO8601",`  
> ` "type": "accountAttribute"`  
> ` },`  
> ` "secondDate": {`  
> ` "type": "dateMath",`  
> ` "attributes": {`  
> ` "expression": "now-1h",`  
> ` "roundUp": true`  
> ` }`  
> ` },`  
> ` "operator": "gt",`  
> ` "positiveCondition": "true",`  
> ` "negativeCondition": "false"`  
> ` }`  
> ` },`  
> ` "within45DaysAfterEndDate": {`  
> ` "type": "dateCompare",`  
> ` "attributes": {`  
> ` "firstDate": {`  
> ` "attributes": {`  
> ` "sourceName": "Terceiros",`  
> ` "attributeName": "endDate"`  
> ` },`  
> ` "inputFormat": "ISO8601",`  
> ` "outputFormat": "ISO8601",`  
> ` "type": "accountAttribute"`  
> ` },`  
> ` "secondDate": {`  
> ` "type": "dateMath",`  
> ` "attributes": {`  
> ` "expression": "now-45d-1h",`  
> ` "roundUp": true`  
> ` }`  
> ` },`  
> ` "operator": "gt",`  
> ` "positiveCondition": "true",`  
> ` "negativeCondition": "false"`  
> ` }`  
> ` },`  
> ` "value": "#if($isActive == 'true')active#elseif($within45DaysAfterEndDate == 'true')bloqueado#{else}inactive#end",`  
> ` "requiresPeriodicRefresh": true`  
> ` },`  
> ` "internal": false`  
> `}`

Expected behavior:

1. If Terceiros.endDate is greater than current date/time minus 1 hour:  
lifecycleState should be active.

2. If Terceiros.endDate is not active anymore, but still within 45 days after the end date:  
lifecycleState should be bloqueado.

3. If Terceiros.endDate is older than 45 days:  
lifecycleState should be inactive

---

<div class="post-metadata">

**Author:** ![rabappy](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@rabappy](https://developer.sailpoint.com/discuss/u/rabappy)\
**Post date:** [June 9, 2026, 4:52am UTC](https://developer.sailpoint.com/discuss/t/datecompare-transform-failing-with-firstdate-null-when-using-accountattribute-from-source-employee/211983/2 "2026-06-09T04:52:20Z")

</div>

Hi Henrique,

The error suggests that for some identities, `Terceiros.endDate` is actually resolving to **null** during refresh:

> `firstDate[null]`

Even though most identities have a value, it only takes a few accounts with a missing, empty, or unparsable `endDate` to trigger the `dateCompare` failure.

A few things I’d check:

- Verify the affected identities have a populated `endDate` on their **Terceiros** account.
- Confirm the value format matches the expected `ISO8601` format.
- Check whether some identities have multiple Terceiros accounts or account correlation issues causing the attribute lookup to return null.
- Consider wrapping the logic with a `firstValid` or a null-handling pattern before passing the value to `dateCompare`.

The reason it may work when you remove the second `dateCompare` is that you’re reducing the number of evaluations against a potentially null attribute. The underlying issue is likely data quality or attribute resolution rather than the comparison logic itself.

I’d start by identifying a few identities from the error logs and inspecting their aggregated `endDate` values directly. That should reveal whether the attribute is missing or not being resolved consistently.

---

<div class="post-metadata">

**Author:** ![UjjwalJain](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ujjwaljain/32/24704_2.png) [@UjjwalJain](https://developer.sailpoint.com/discuss/u/UjjwalJain)\
**Post date:** [June 9, 2026, 6:00am UTC](https://developer.sailpoint.com/discuss/t/datecompare-transform-failing-with-firstdate-null-when-using-accountattribute-from-source-employee/211983/3 "2026-06-09T06:00:22Z")

</div>

Hi @henriqueoliveira2026,

I noticed several syntax issues in the transform you shared. Could you please try using the transform attached below and make any necessary adjustments before testing? I’ve also included reference documentation links for your convenience.

[Account attribute | SailPoint Developer Community](https://developer.sailpoint.com/docs/extensibility/transforms/operations/account-attribute)  
[Date Math | SailPoint Developer Community](https://developer.sailpoint.com/docs/extensibility/transforms/operations/date-math/)  
[Date Compare | SailPoint Developer Community](https://developer.sailpoint.com/docs/extensibility/transforms/operations/date-compare/)

```auto
{

    "type": "static",

    "attributes": {

        "isActive": {

            "type": "dateCompare",

            "attributes": {

                "firstDate": {

                    "attributes": {

                        "input": {

                            "attributes": {

                                "sourceName": "Terceiros",

                                "attributeName": "endDate"

                            },

                            "type": "accountAttribute"

                        },

                        "inputFormat": "<Please specify the format you are getting from Terceiros Source>",

                        "outputFormat": "ISO8601"

                    },

                    "type": "dateFormat"

                },

                "secondDate": {

                    "attributes": {

                        "input": {

                            "type": "dateMath",

                            "attributes": {

                                "expression": "now-1h",

                                "roundUp": true

                            }

                        },

                        "inputFormat": "yyyy-MM-dd'T'HH:mm",

                        "outputFormat": "ISO8601"

                    },

                    "type": "dateFormat"

                },

                "operator": "gt",

                "positiveCondition": "true",

                "negativeCondition": "false"

            }

        },

        "within45DaysAfterEndDate": {

            "type": "dateCompare",

            "attributes": {

                "firstDate": {

                    "attributes": {

                        "input": {

                            "attributes": {

                                "sourceName": "Terceiros",

                                "attributeName": "endDate"

                            },

                            "type": "accountAttribute"

                        },

                        "inputFormat": "<Please specify the format you are getting from Terceiros Source>",

                        "outputFormat": "ISO8601"

                    },

                    "type": "dateFormat"

                },

                "secondDate": {

                    "attributes": {

                        "input": {

                            "type": "dateMath",

                            "attributes": {

                                "expression": "now-45d-1h",

                                "roundUp": true

                            }

                        },

                        "inputFormat": "yyyy-MM-dd'T'HH:mm",

                        "outputFormat": "ISO8601"

                    },

                    "type": "dateFormat"

                },

                "operator": "gt",

                "positiveCondition": "true",

                "negativeCondition": "false"

            }

        },

        "value": "#if($isActive == 'true')active#elseif($within45DaysAfterEndDate == 'true')bloqueado#{else}inactive#end",

        "requiresPeriodicRefresh": true

    }

}

```

---

<div class="post-metadata">

**Author:** ![UjjwalJain](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ujjwaljain/32/24704_2.png) [@UjjwalJain](https://developer.sailpoint.com/discuss/u/UjjwalJain)\
**Post date:** [June 10, 2026, 12:30pm UTC](https://developer.sailpoint.com/discuss/t/datecompare-transform-failing-with-firstdate-null-when-using-accountattribute-from-source-employee/211983/4 "2026-06-10T12:30:34Z")

</div>

Hi @henriqueoliveira2026,

Did you get a chance to try the transform?  
Please let us know if it works.

---

<div class="post-metadata">

**Author:** ![henriqueoliveira2026](https://avatars.discourse-cdn.com/v4/letter/h/b38774/32.png) [@henriqueoliveira2026](https://developer.sailpoint.com/discuss/u/henriqueoliveira2026)\
**Post date:** [June 10, 2026, 1:16pm UTC](https://developer.sailpoint.com/discuss/t/datecompare-transform-failing-with-firstdate-null-when-using-accountattribute-from-source-employee/211983/5 "2026-06-10T13:16:25Z")

</div>

Hello,

I tried to solve it, but in my view, dealing with lifecycle data generates errors in the identity, even though it manages to resolve the lifecycle, the identity remains with an error.

---

<div class="post-metadata">

**Author:** ![UjjwalJain](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ujjwaljain/32/24704_2.png) [@UjjwalJain](https://developer.sailpoint.com/discuss/u/UjjwalJain)\
**Post date:** [June 10, 2026, 1:19pm UTC](https://developer.sailpoint.com/discuss/t/datecompare-transform-failing-with-firstdate-null-when-using-accountattribute-from-source-employee/211983/6 "2026-06-10T13:19:30Z")

</div>

What is the error on the identity ?

---

<div class="post-metadata">

**Author:** ![margocbain](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/margocbain/32/17314_2.png) [@margocbain](https://developer.sailpoint.com/discuss/u/margocbain)\
**Post date:** [June 10, 2026, 6:49pm UTC](https://developer.sailpoint.com/discuss/t/datecompare-transform-failing-with-firstdate-null-when-using-accountattribute-from-source-employee/211983/7 "2026-06-10T18:49:46Z")

</div>

> [@henriqueoliveira2026](#):
>
> `"firstDate": {`  
> ` "attributes": {`  
> ` "sourceName": "Terceiros",`  
> ` "attributeName": "endDate"`  
> ` },`

Hi Henrique,

Try adding a ‘firstValid’ to this section. First value can be the endDate from Terceiros, the fallback can be 12/31/9999 (in ISO8601 format)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [August 9, 2026, 6:49pm UTC](https://developer.sailpoint.com/discuss/t/datecompare-transform-failing-with-firstdate-null-when-using-accountattribute-from-source-employee/211983/8 "2026-08-09T18:49:52Z")

</div>

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