Thank you for the clarification, I had to modify the leaving variable to get it working. See below!
{
"name": "BLV_Workday_LCS",
"type": "static",
"attributes": {
"requiresPeriodicRefresh": "true",
"activestate": {
"attributes": {
"firstDate": "now",
"secondDate": {
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "HIREDATE",
"sourceName": "Workday"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"operator": "GTE",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"futureContractor": {
"attributes": {
"firstDate": {
"attributes": {
"expression": "now+14d/d",
"roundUp": false
},
"type": "dateMath"
},
"secondDate": {
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "HIREDATE",
"sourceName": "Workday"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"operator": "GTE",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"farFutureContractor": {
"attributes": {
"firstDate": {
"attributes": {
"expression": "now+15d/d",
"roundUp": false
},
"type": "dateMath"
},
"secondDate": {
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "HIREDATE",
"sourceName": "Workday"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"operator": "LT",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"inactivestate": {
"attributes": {
"firstDate": "now",
"secondDate": {
"type": "firstValid",
"attributes": {
"values": [
{
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "CONTRACT_END_DATE",
"sourceName": "Workday"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"now"
],
"ignoreErrors": "true"
}
},
"operator": "GT",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"leaving": {
"attributes": {
"firstDate": {
"attributes": {
"expression": "now+14d/d",
"roundUp": false
},
"type": "dateMath"
},
"secondDate": {
"type": "firstValid",
"attributes": {
"values": [
{
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "CONTRACT_END_DATE",
"sourceName": "Workday"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
{
"attributes": {
"expression": "now+14d/d",
"roundUp": false
},
"type": "dateMath"
}
]
}
},
"operator": "GT",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"value": "#if($inactivestate=='yes')inactive#elseif($leaving=='yes')leaving#elseif(($activestate=='yes') && ($inactivestate=='no'))active#elseif(($futureContractor=='yes')&&($activestate=='no'))futureContractor#elseif(($futureContractor=='no')&&($activestate=='no'))farFutureContractor#{else}UNKNOWN#end"
},
"internal": false
}