Transform that calculates difference between today and ISO8601 date attribute in days

Hi @khalilgahbiche!

A couple of things -

  1. We don’t have access to Velocity libraries like dateTool or mathTool, unfortunately, which makes any sort of math more difficult to implement in a Transform. See this post and the linked Idea where I’ve requested adding dateTool and numberTool to Transforms (they’re already used elsewhere in the platform, though mathTool is not).
  2. It’s still possible to use simple addition, subtraction, etc., but the bigger issue in this sort of transform would be converting the date to something we could actually do math on. It’s probably doable if we’re talking about dates within a year of each other, but beyond that it gets really tricky with leap years and whatnot.

As for the attribute itself, see the transform I’ve shared here for a more robust version of what @sameertawargeri did above. This looks not only at the lastSignInDateTime from Entra, but also the lastNonInteractiveSignInDateTime as well as the lastLogon, lastLogonTimestamp, pwdLastSet, and whenCreated from Active Directory, and returns the value that is the most recent. You could then do a dateCompare and see if the returned value is >90 days in the past, and use that to change their Lifecycle State or trigger the workflow.

Good luck!

1 Like