The search interface in IdentityNow requires all date values to be in ISO8601 format (yyyy-MM-dd'T'HH:mm:ss.SSSZ or yyyy-MM-dd) to be searchable. Many authoritative source systems do not store dates in either of these formats, therefore if identity attributes like startDate or endDate are mapped to source account attributes whose values are in the wrong date format, those date values will not be properly searchable in search.
For example, if the startDate values are in the MM/dd/yyyy format, a search for identities whose start date is before January 1, 2016, will return erroneous results:
The above search is returning zero results even though doing a search to find all identities shows us that there are clearly identities with start dates before January 1, 2016:
We need to build and apply a transform to the startDate identity attribute that converts the values to a format that is searchable in search. There is a primitive operation, dateFormat, that does exactly this.
Within the attributes section of the of the dateFormat primitive operation, we configure the inputFormat to match the incoming format of our date values and the outputFormat to our desired output date format:
{
"name": "FormattedDate",
"type": "dateFormat",
"attributes": {
"inputFormat": "MM/dd/yyyy",
"outputFormat": "yyyy-MM-dd"
}
}
We deploy this transform to the tenant with the POST v3/transforms API endpoint in Postman:
Then we apply the transform to the stateDate identity attribute on the Identity Profile > Mappings page:
After the stateDate identity attribute values have been recalculated with the new transform, our original search will now return correct results:
Note: when trying to set up a custom identity attribute as a date/time, you need to append "DateType" to the end of the attribute's system name in order for the system to recognize it as a date and be searchable as such.
@sup3rmark, once append "DateType", how can we build the search query to use it?
I also found this in the documentation:
Note that if you add custom attributes to your identity profile, you can search on those as well using the technical name of the attribute. You can also configure your custom attributes to use the date type of value by adding the string dateType to the end of your attribute name.