Hi All,
Looking for some help in figuring out the issue with a transform.
Below is transform that compares Hire/Start Date with current date/time and based on the no. of days difference, set a static value, for example EXPIRESIN5DAYS. This transform is then used to send out password expiration notifications. The transform is working fine except in condition, which is what I am trying to solve. For a user, if the start or hire date is 03/18/2025 ,so the transform should return value EXPIRESIN5DAYS on 03/18/2025 (Day 0), EXPIRESIN4DAYS on 03/19/2025 (Day 1), EXPIRESIN3DAYS on 03/20 (Day 2), EXPIRESON2DAYS (Day 3), EXPIERSIN1DAY (Day 4) and EXPIRED on Day5. However if you see on the screenshot, below, the transform is changing from FALSE to EXPIRESIN5DAYS and then to EXPIERSIN4DAYS on the 03/18 start/hire date itself, causing the notifications to be sent out 1 day early.
I did tried adding an offset of 5h but that didn’t helped.
Any pointers on the issue?
{
"name": "Flag - New Joiner AD Password Expiration",
"type": "static",
"attributes": {
"lifecycleState": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "identityAttribute",
"attributes": {
"name": "cloudLifecycleState"
}
},
"INVALID"
]
}
},
"adAccountCheck": {
"type": "static",
"attributes": {
"adFirstValid": {
"type": "firstValid",
"attributes": {
"values": [
{
"attributes": {
"sourceName": "CLIENT Active Directory",
"attributeName": "sAMAccountName"
},
"type": "accountAttribute"
},
"ADNOTFOUND"
]
}
},
"value": "#if($adFirstValid==\"ADNOTFOUND\")ADNOTFOUND#{else}ADFOUND#end"
}
},
"newJoinerCheck": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateFormat",
"attributes": {
"inputFormat": "EPOCH_TIME_WIN32",
"outputFormat": "ISO8601",
"input": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CLIENT Active Directory",
"attributeName": "pwdLastSet"
}
},
"441481875030000000"
]
}
}
}
},
"secondDate": {
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-MM-dd",
"outputFormat": "ISO8601",
"input": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CHGE Workday",
"attributeName": "HIRE_DATE__c"
}
},
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CLIENT NERM Contractors",
"attributeName": "Start_Date"
}
},
"2000-01-01"
]
}
}
}
},
"operator": "lt",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"sameDayHireCheck": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateFormat",
"attributes": {
"input": {
"type": "substring",
"attributes": {
"input": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CLIENT Active Directory",
"attributeName": "accountExpires"
}
},
"01/01/2000"
]
}
},
"begin": 0,
"end": 10
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
}
},
"secondDate": {
"type": "dateMath",
"attributes": {
"expression": "+5d/d",
"roundUp": false,
"input": {
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-MM-dd",
"outputFormat": "ISO8601",
"input": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CHGE Workday",
"attributeName": "HIRE_DATE__c"
}
},
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CLIENT NERM Contractors",
"attributeName": "Start_Date"
}
},
"2000-01-01"
]
}
}
}
}
}
},
"operator": "lte",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"ifExpired": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateMath",
"attributes": {
"expression": "+5d/d",
"roundUp": false,
"input": {
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-MM-dd",
"outputFormat": "ISO8601",
"input": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CHGE Workday",
"attributeName": "HIRE_DATE__c"
}
},
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CLIENT NERM Contractors",
"attributeName": "Start_Date"
}
},
"2000-01-01"
]
}
}
}
}
}
},
"secondDate": "now",
"operator": "lte",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"ifOneDayLeft": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateMath",
"attributes": {
"expression": "+4d+5h",
"roundUp": false,
"input": {
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-MM-dd",
"outputFormat": "ISO8601",
"input": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CHGE Workday",
"attributeName": "HIRE_DATE__c"
}
},
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CLIENT NERM Contractors",
"attributeName": "Start_Date"
}
},
"2000-01-01"
]
}
}
}
}
}
},
"secondDate": "now",
"operator": "lte",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"ifTwoDaysLeft": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateMath",
"attributes": {
"expression": "+3d+5h",
"roundUp": false,
"input": {
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-MM-dd",
"outputFormat": "ISO8601",
"input": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CHGE Workday",
"attributeName": "HIRE_DATE__c"
}
},
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CLIENT NERM Contractors",
"attributeName": "Start_Date"
}
},
"2000-01-01"
]
}
}
}
}
}
},
"secondDate": "now",
"operator": "lte",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"ifThreeDaysLeft": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateMath",
"attributes": {
"expression": "+2d+5h",
"roundUp": false,
"input": {
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-MM-dd",
"outputFormat": "ISO8601",
"input": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CHGE Workday",
"attributeName": "HIRE_DATE__c"
}
},
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CLIENT NERM Contractors",
"attributeName": "Start_Date"
}
},
"2000-01-01"
]
}
}
}
}
}
},
"secondDate": "now",
"operator": "lte",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"ifFourDaysLeft": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateMath",
"attributes": {
"expression": "+1d+5h",
"roundUp": false,
"input": {
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-MM-dd",
"outputFormat": "ISO8601",
"input": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CHGE Workday",
"attributeName": "HIRE_DATE__c"
}
},
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CLIENT NERM Contractors",
"attributeName": "Start_Date"
}
},
"2000-01-01"
]
}
}
}
}
}
},
"secondDate": "now",
"operator": "lte",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"ifFiveDaysLeft": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateMath",
"attributes": {
"expression": "+0d+5h",
"roundUp": false,
"input": {
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-MM-dd",
"outputFormat": "ISO8601",
"input": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CHGE Workday",
"attributeName": "HIRE_DATE__c"
}
},
{
"type": "accountAttribute",
"attributes": {
"sourceName": "CLIENT NERM Contractors",
"attributeName": "Start_Date"
}
},
"2000-01-01"
]
}
}
}
}
}
},
"secondDate": "now",
"operator": "lte",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"value": "#if($lifecycleState==\"active\" && $adAccountCheck==\"ADFOUND\" && ($newJoinerCheck==\"true\" || $sameDayHireCheck==\"true\"))#if($ifExpired==\"true\")EXPIRED#elseif($ifOneDayLeft==\"true\")EXPIRESIN1DAY#elseif($ifTwoDaysLeft==\"true\")EXPIRESIN2DAYS#elseif($ifThreeDaysLeft==\"true\")EXPIRESIN3DAYS#elseif($ifFourDaysLeft==\"true\")EXPIRESIN4DAYS#elseif($ifFiveDaysLeft==\"true\")EXPIRESIN5DAYS#{else}FALSE#end#elseif($lifecycleState==\"active\" && $adAccountCheck==\"ADNOTFOUND\")$adAccountCheck#{else}FALSE#end"
},
"internal": false
}