Hello @Mane1,
This one took a little creativity, it is possible! Using DateMath, DateFormat, DateCompare, and the Static transform you can accomplish what you are looking for. You can use DateMath to take todays date "now"
+ the number of days you want to check. Then you can use the DateFormat transform on both the generated date and the date coming from your source to use within a date compare.
I wrote up a quick template for you to test out. You will need to replace <accountName>
, <sourceName>
, and <SimpleDateFormatOfEndDate>
with your specific values in your tenant.
{
"name": "EndDateCompare",
"type":"static",
"attributes": {
"inPast": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateFormat",
"attributes": {
"input": {
"type":"dateMath",
"attributes": {
"expression": "now"
}
},
"inputFormat": "yyyy-MM-dd'T'HH:mm",
"outputFormat": "ISO8601"
}
},
"secondDate": {
"type": "dateFormat",
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"sourceName": "<sourceName>",
"attributeName": "<attributeName>"
}
},
"inputFormat": "<SimpleDateFormatOfEndDate>",
"outputFormat": "ISO8601"
}
},
"operator": "lte",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"7DayCheck": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateFormat",
"attributes": {
"input": {
"type":"dateMath",
"attributes": {
"expression": "now+7d"
}
},
"inputFormat": "yyyy-MM-dd'T'HH:mm",
"outputFormat": "ISO8601"
}
},
"secondDate": {
"type": "dateFormat",
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"sourceName": "<sourceName>",
"attributeName": "<attributeName>"
}
},
"inputFormat": "<SimpleDateFormatOfEndDate>",
"outputFormat": "ISO8601"
}
},
"operator": "lte",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"15DayCheck": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateFormat",
"attributes": {
"input": {
"type":"dateMath",
"attributes": {
"expression": "now+15d"
}
},
"inputFormat": "yyyy-MM-dd'T'HH:mm",
"outputFormat": "ISO8601"
}
},
"secondDate": {
"type": "dateFormat",
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"sourceName": "<sourceName>",
"attributeName": "<attributeName>"
}
},
"inputFormat": "<SimpleDateFormatOfEndDate>",
"outputFormat": "ISO8601"
}
},
"operator": "lte",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"25DayCheck": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateFormat",
"attributes": {
"input": {
"type":"dateMath",
"attributes": {
"expression": "now+25d"
}
},
"inputFormat": "yyyy-MM-dd'T'HH:mm",
"outputFormat": "ISO8601"
}
},
"secondDate": {
"type": "dateFormat",
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"sourceName": "<sourceName>",
"attributeName": "<attributeName>"
}
},
"inputFormat": "<SimpleDateFormatOfEndDate>",
"outputFormat": "ISO8601"
}
},
"operator": "gt",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"value": "#if($7DayCheck=='true'&&inPast=='false')abcdActiveetc#elseif($15DayCheck=='true'&&inPast=='false')xyzzActive#elseif($25DayCheck=='true'&&inPast=='false')Active#{else}terminated#end"
}
}