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:
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).
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
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.
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.