cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Format Identity Attribute Date Values to Be Searchable in Search

How to Format Identity Attribute Date Values to Be Searchable in Search

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:

date search.png

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:

date search 2.png

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:

Postman transform FormattedDate.png

Then we apply the transform to the stateDate identity attribute on the Identity Profile > Mappings page:

startDate transform.png

After the stateDate identity attribute values have been recalculated with the new transform, our original search will now return correct results:

date search 3.png

 

Comments

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.
Version history
Revision #:
4 of 4
Last update:
‎Sep 29, 2022 12:40 PM
Updated by:
 
Contributors