Date Compare Transform Error

Hi,

We are using below transform:

{
      "attributes": {
          "firstDate": "now",
          "secondDate": {
              "attributes": {
                  "input": {
                      "type": "accountAttribute",
                      "attributes": {
                          "attributeName": "contractStartDate",
                          "sourceName": "HR Employees"
                      }
                  },
                  "inputFormat": "yyyy-MM-dd",
                  "outputFormat": "ISO8601"
              },
              "type": "dateFormat"
          },
          "operator": "GTE",
          "positiveCondition": "yes",
          "negativeCondition": "no"
      },
      "type": "dateCompare"
  }

We are getting below error if the date on the identity attribute is in different format from yyyy-MM-dd.
"IllegalArgumentException: DateMathTransform requires an input date or date expression with ‘now’ "

Is there any way we can use in transform that user enters the date in any format and is parsed by transform without any error?

Hi @Mahak14

this error means that one of your dates are not correct and looks like the secondDate is the problem, I can’t replicate the error because in fact for me your transform is working something like this:

{
    "attributes": {
        "firstDate": "now",
        "secondDate": {
            "attributes": {
                "input": "2022-01-30",
                "inputFormat": "yyyy-MM-dd",
                "outputFormat": "ISO8601"
            },
            "type": "dateFormat"
        },
        "operator": "GTE",
        "positiveCondition": "yes",
        "negativeCondition": "no"
    },
    "type": "dateCompare"
}

this error means that second date is not a valid date and the transform can’t perform the evaluation of the expression, please check that everything is correct and IdentityNow can read the account attribute “contractStartDate” without any problem.

Hi,

The inputformat in the transform is set as yyyy-MM-dd, and in the identity the format for date is mm/dd/yyyy.
Is there any way , we can edit the transform that transform accepts the date in other formats as well.

Hello @Mahak14,

If your date format on the identities is in the format mm/dd/yyyy you can modify the transform to the snippet below and it will accept those dates. Take a look at our developer docs for dateFormat. The input format can be specified in a few different ways using our named constructs or the Java SimpleDateFormat. (IdentityNow Transforms - Date Format | SailPoint API References).

If you are looking to specify multiple input date formats to be transformed into the ISO8601 format the dateFormat transform does not allow this and it would have to be done another way. If that is what you are looking to do, let us know and we can help formulate a solution for that.

1 Like