Transforms operations

Hi,

I have an AD Attribute : LastLogonDate, I trying to find a transform that checks the difference between current date and lastlogondate and should return the difference.

Is there any operation in transform to find difference between dates. I know we have operations (LE, GE, LTE, GTE), But i’m looking for operations that give me the difference.

There’s no operation that will allow you to add/subtract two dates. The dateMath operator only allows you to add/subtract fixed quantities to a single date.

Is there a specific time difference you are looking for? Are you trying to determine if the lastlogondate is 30 days ago from now? If so, you could do a dateMath on the lastlogondate to add 30 days to it, and then compare the current date with the modified lastlogondate to see if it is greater or lesser. For example:

lastlogondate = 1-01-2023T00:00:00Z
projectedLogonDate = lastlogondate + 30d = 1-31-2023T00:00:00Z

if now < projectedLogonDate then ACTIVE else INACTIVE

when now = 1-30-2023T00:00:00Z, result will be ACTIVE
when now = 2-01-2023T00:00:00Z, result will be INACTIVE

1 Like

@chandramohan2706 did that solve your use case?

@colin_mckibben

Yes, It solved my use case. I can now have an identity attribute with transform that do datecompare with lastlogon vs now.

Thanks much for your help !:slightly_smiling_face:

1 Like

Hey @colin_mckibben

Is there a way to check for equality of two dates? Like wanting to return true if date1 and date2 are exactly the same, and false otherwise.

The use case is that I want to check if a particular date is 14 days from now, which I can do with dateMath to add 14 days, but I cannot do an equals operation in date compare transform. If I were to use LTE or GTE, I won’t get the desired result.

(Can think of a workaround where if both GTE and LTE conditions are true, it essentially means the dates are equal but would prefer a cleaner way).

1 Like

You can try using the conditional transform and compare the date values as strings. If that doesn’t work, you can use the workaround you posted above(using GTE and LTE). Example posted by someone in this post : Conditional Transforms for Contractor expiration - #8 by iam_nithesh

2 Likes

Hi @sharvari, that’s exactly right, but as I mentioned, I was looking for a better way to achieve the same result, as it is a lot of manual computation just to achieve an equality operation for two dates through this workaround. This might be okay if only one equality operation was to be done, but it is hard to scale if we want to do it multiple times in the same transform, with say different dates.

For now I’ve been able to write the logic in a way that use LTE operator, but if an operator like EQ is supported in the future in date compare transforms, I will revisit and rewrite it to make it simpler.

1 Like

I agree with you.

You can post an idea for the same on the Idea portal to get votes and visibility so we can get it on the Sailpoint Roadmap as an enhancement to the Date Compare transform operations.

1 Like

The idea is posted: https://ideas.sailpoint.com/ideas/GOV-I-2658

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