Hello @vijay_sharma,
I believe this can be done with a transform. I have written something that you can use to build off of with static values.
{
"name": "Latest Date",
"type": "static",
"attributes": {
"date1": {
"type": "static",
"attributes": {
"value": "2022-05-15"
}
},
"date2": {
"type": "static",
"attributes": {
"value": "2022-05-12"
}
},
"date3": {
"type": "static",
"attributes": {
"value": "2022-05-14"
}
},
"date1gt2": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-mm-dd",
"outputFormat": "ISO8601",
"input": "2022-05-15"
}
},
"secondDate": {
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-mm-dd",
"outputFormat": "ISO8601",
"input": "2022-05-12"
}
},
"operator": "gt",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"date1gt3": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-mm-dd",
"outputFormat": "ISO8601",
"input": "2022-05-15"
}
},
"secondDate": {
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-mm-dd",
"outputFormat": "ISO8601",
"input": "2022-05-14"
}
},
"operator": "gt",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"value": "#if($date1gt2=='true'&&$date1gt3=='true')$date1#elseif($date1gt2=='false'&&$date1gt3=='true')$date2#{else}$date3#end"
}
}
You will want to replace the static input strings with the dates from your sources. Your transform will look something more like the following. Be sure to replace the <attribute#>
and <source#>
with your values.
{
"name": "Latest Date",
"type": "static",
"attributes": {
"date1": {
"type": "accountAttribute",
"attributes": {
"attributeName": "<attribute1>",
"sourceName": "<source1>"
}
},
"date2": {
"type": "accountAttribute",
"attributes": {
"attributeName": "<attribute2>",
"sourceName": "<source2>"
}
},
"date3": {
"type": "accountAttribute",
"attributes": {
"attributeName": "<attribute3>",
"sourceName": "<source3>"
}
},
"date1gt2": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-mm-dd",
"outputFormat": "ISO8601",
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "<attribute1>",
"sourceName": "<source1>"
}
}
}
},
"secondDate": {
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-mm-dd",
"outputFormat": "ISO8601",
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "<attribute2>",
"sourceName": "<source2>"
}
}
}
},
"operator": "gt",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"date1gt3": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-mm-dd",
"outputFormat": "ISO8601",
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "<attribute1>",
"sourceName": "<source1>"
}
}
}
},
"secondDate": {
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-mm-dd",
"outputFormat": "ISO8601",
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "<attribute3>",
"sourceName": "<source3>"
}
}
}
},
"operator": "gt",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"value": "#if($date1gt2=='true'&&$date1gt3=='true')$date1#elseif($date1gt2=='false'&&$date1gt3=='true')$date2#{else}$date3#end"
}
}