IdentityNow Transforms - Date Compare

IdentityNow Transforms - Date Compare

Overview

The date compare transform allows you to easily compare two dates and, based on the result of the comparison, return one value if one date is after the other, or a different value if it is before the other. A common use case for this type of transform is to calculate lifecycle states (e.g., the user is "active" if the current date is greater than or equal to the user's hire date, etc.).

Other Considerations

  • In addition to explicit date values, the transform recognizes the "now" keyword that will always evaluate to the exact date and time at which the transform is evaluating.
  • All dates must be in ISO8601 format in order for the date compare transform to evaluate properly.

 

Transform Structure

The date compare transform takes as an input the two dates to compare, denoted as firstDate and secondDate. It also requires an operator designation so that the transform knows which condition to evaluate for. Lastly, it requires both a positiveCondition and a negativeCondition -- the former is what will be returned if the comparison evaluates to true, and the latter is what will be returned if the comparison evaluates to false.

Example

{
  "attributes": {
    "firstDate": {
      "attributes": {
        "sourceName": "HR Source",
        "attributeName": "termination_date"
      },
      "type": "accountAttribute"
    },
    "secondDate": "now",
    "operator": "gt",
    "positiveCondition": "active",
    "negativeCondition": "terminated"
  },
  "type": "dateCompare",
  "name": "Test Date Compare Transform"
}

Attributes

  • Required Attributes

    • type - This must always be set to dateCompare

    • name - This is a required attribute for all transforms, and represents the name of the transform as it will appear in the UI's dropdowns

    • firstDate - This is the first date to consider (i.e., the date that would be on the left hand side of the comparison operation)

    • secondDate - This is the second date to consider (i.e., the date that would be on the right hand side of the comparison operation)

    • operator - This is the comparison to perform. Valid values are:

      • LT: Strictly less than: firstDate < secondDate
      • LTE: Less than or equal to: firstDate <= secondDate
      • GT: Strictly greater than: firstDate > secondDate
      • GTE: Greater than or equal to: firstDate >= secondDate
    • positiveCondition - This is the value to return if the comparison is true

    • negativeCondition - This is the value to return if the comparison is false

  • Optional Attributes
    • requiresPeriodicRefresh - A true or false value that indicates whether the transform logic should be re-evaluated every evening as part of the identity refresh process.

 

Examples

Example 1

{
  "attributes": {
    "firstDate": {
      "attributes": {
        "sourceName": "HR Source",
        "attributeName": "termination_date"
      },
      "type": "accountAttribute"
    },
    "secondDate": "now",
    "operator": "gt",
    "positiveCondition": "active",
    "negativeCondition": "terminated"
  },
  "type": "dateCompare",
  "name": "Test Date Compare Transform"
}

This transform accomplishes a basic lifecycle state calculation. It compares the user's termination date from his/her HR record and, if the current datetime (denoted by now) is less than that date, the transform returns "active." Otherwise, the transform will return "terminated."

Example 2

{
  "attributes": {
    "firstDate": {
      "attributes": {
        "sourceName": "HR Source",
        "attributeName": "hire_date"
      },
      "type": "accountAttribute"
    },
    "secondDate": {
      "attributes": {
        "input": "12/31/1995",
        "inputFormat": "M/d/yyyy",
        "outputFormat": "ISO8601"
      },
      "type": "dateFormat"
    },
    "operator": "lte",
    "positiveCondition": "legacy",
    "negativeCondition": "regular"
  },
  "type": "dateCompare",
  "name": "Test Date Compare Transform"
}

This transform compares the user's hire date to a fixed date in the past. If the user was hired prior to January 1, 1996, the transform will return "legacy," otherwise it will return "regular."

 

References

  • N/A
Tags (1)
Comments

you need to account for a null value in the termination date. otherwise if term date is null you get an error

https://community.sailpoint.com/t5/IdentityNow-Forum/Null-check-in-transforms/m-p/170978

Hi Team,

Please help me on below question

 Can we get current date dynamically  in positive condition?

Thanks in advance

 

 

Version history
Revision #:
4 of 4
Last update:
‎Dec 09, 2021 03:46 PM
Updated by:
 
Contributors