I need to have a transform where it will compare the date based on hire date from account attribute and a static date. If hire date(firstDate) is less than equal to static date(secondDate) then return yes else return HireDate. If boolean value is yes then return startDate identity attribute.
When it is suppose to return StartDate and startDate identity attribute then it is returning static value from StartDate. Below scenarios would make it clear.
-
If hire date is 06/12/2017 which is smaller than static date 05/28/2021(secondDate) then it will meet this condition #if($isNewStartDate == ‘Yes’)$StartDate.
Current startDate(identityAttribute) is lets say 2017-08-01 then it should have retain the value and return 2017-08-01 but start date is becoming static value of startDate i.e 2020-05-20.- Not Expected
-
If hire date is empty then output is 2020-05-20. - Expected
-
If hire date is 07/31/2024 then output is 2024-07-31 - Expected
Can anyone please suggest why scenario 1 is not working as expected?
Please find below the transform.
{
"name": "StartDate",
"type": "static",
"attributes": {
"StartDate": {
"attributes": {
"input": {
"attributes": {
"values": [
{
"attributes": {
"attributeName": "startDate"
},
"type": "identityAttribute"
},
"2020-05-20"
]
},
"type": "firstValid"
},
"inputFormat": "yyyy-MM-dd",
"outputFormat": "yyyy-MM-dd"
},
"type": "dateFormat"
},
"hireDate": {
"attributes": {
"input": {
"attributes": {
"attributeName": "HireDate",
"sourceName": "Some Source"
},
"type": "accountAttribute"
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "yyyy-MM-dd"
},
"type": "dateFormat"
},
"isNewStartDate": {
"attributes": {
"negativeCondition": "No",
"positiveCondition": "Yes",
"firstDate": {
"attributes": {
"input": {
"attributes": {
"values": [
{
"attributes": {
"attributeName": "HireDate",
"sourceName": "Some Source"
},
"type": "accountAttribute"
},
"06/21/2018"
]
},
"type": "firstValid"
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"secondDate": {
"attributes": {
"input": "05/28/2021",
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"operator": "lte"
},
"type": "dateCompare"
},
"value": "#if($isNewStartDate == 'Yes')$StartDate#{else}$hireDate#end"
},
"internal": false
}