Report parameter issue comparing the date(userInput) vs String(identity attribute)

Which IIQ version are you inquiring about?

Version 8.X

Share all details related to your problem, including any error messages you may have received.

Hi Team,

Using the IdentityIQ 8.2 environment. I have a requirement.

In identityIQ for Identity attribute storing the start date in String format::

Identity Attribute: example
start date:: 16/5/2023

I wanted to pull the identities using the custom report of type “Filter” as datasource where startDate < 7/06/2024(example) .

But in form user inputing the data field as Date:

Form Input::

can you help me is there any way to pull the data from Report since comparing date vs string is not possible.

Regards,
Ravi.

Regards,
Ravi.

Regards,
Ravi.

Regards,
Ravi

@kolipakularaviturnkey
Are you sure your data in identity is always correct and consistent with the given date format, if that’s case
Also how is this Stored in DB level as String or a epoch time format?

If possible, can you please share sample identity from debug page

key=“startdate” value=“03/05/2021”

If you are using Filter DataSource in the report I don’t think there is a direct way to do this unless you have another field at Identity level with date type ( that gets synced with a rule based on this date)

Can you share your report task definition xml, I think using java data source this is achievable without creating an identity attribute.

Other experts can comment if they have any other alternative

Hi @kolipakularaviturnkey, you can try like this… String startDate= “01/01/2021 13:27:44”;
QueryOptions options = new QueryOptions();
Calendar cal = Calendar.getInstance();
Date currentDate = cal.getTime();
Long currentMilis = cal.getTimeInMillis();
SimpleDateFormat sf = new SimpleDateFormat(“MM/dd/yyyy HH:mm:ss”);
Date d = sf.parse(startDate);
cal.setTime(d);
Date launchTimeDate = cal.getTime();
Long launchTime = cal.getTimeInMillis();

Filter f1 = Filter.gt(“created”, launchTimeDate);
Filter f2 = Filter.lt(“created”, currentDate);
Filter fr = Filter.and(f2,f1);
options.addOrdering(“created”, true);
options.addFilter(fr);
log.debug("Options Filter: "+options);
Iterator it = context.search(Identity.class, options);
while (it.hasNext()) {

// logic

}

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