Hello all,
Hoping someone can help.
We have a transform which checks if someone joined the organisation in the past two years, which works great.
However, we have been asked to extend this so that it only picks up individuals that started after a specific date.
Existing Transform is as below:
{
"id": "ID Placeholder",
"name": "StartDate - PlusTwoYears",
"type": "dateCompare",
"attributes": {
"firstDate": {
"attributes": {
"input": {
"attributes": {
"values": [
{
"attributes": {
"attributeName": "StartDate",
"sourceName": "HR Data"
},
"type": "accountAttribute"
},
{
"attributes": {
"value": "12/31/2999"
},
"type": "static"
}
]
},
"type": "firstValid"
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"secondDate": {
"attributes": {
"input": "",
"expression": "now-730d"
},
"type": "dateMath"
},
"negativeCondition": "false",
"operator": "GT",
"positiveCondition": "true"
},
"internal": false
}
I’ve tried a few methods of adding a static date for comparison, as well as the HR data we are checking, but each time I get an error - so my configuration must be incorrect.
Any guidance would be appreciated.
Thanks, Daniel.
have you tried static block seperately? I mean in the above transform make seperate block for static
1 Like
Thanks for your reply on this.
If I have understood correctly, no I haven’t done that - currently I’m comparing StartDate to now-730d, effectively what I also need is to compare against this static date. So even if the condition is met from the first compare, if the date is before the static date, then set to false. If that makes sense?
If this fits with your suggestion, would this then be a totally separate date compare, or part of the same block?
Thanks again for your input.
try this let me know….
{
“name”: “trythis”,
“type”: “static”,
“attributes”: {
"afterCutoff": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateFormat",
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "StartDate",
"sourceName": "HR Data"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
}
},
"secondDate": {
"type": "dateFormat",
"attributes": {
"input": {
"type": "static",
"attributes": {
"value": "01/01/2022"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
}
},
"operator": "gt",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"withinTwoYears": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateFormat",
"attributes": {
"input": {
"type": "firstValid",
"attributes": {
"values": \[
{
"type": "accountAttribute",
"attributes": {
"attributeName": "StartDate",
"sourceName": "HR Data"
}
},
{
"type": "static",
"attributes": {
"value": "12/31/2999"
}
}
\]
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
}
},
"secondDate": {
"type": "dateMath",
"attributes": {
"expression": "now-730d"
}
},
"operator": "gt",
"positiveCondition": "true",
"negativeCondition": "false"
}
},
"value": "#if($afterCutoff == 'true' && $withinTwoYears == 'true')true#{else}false#end"
}
}
Hello @DanielJackson1405
If you want to use a static date, then, you have to convert that into ISO8601 format so that it can be used with DateCompare function.
1 Like
rpriya
(Priya Rudra)
February 4, 2026, 12:51pm
6
You can re-use your existing logic twice with slight updates as -
{
"name": "test date compare",
"type": "dateCompare",
"attributes": {
"firstDate": {
"attributes": {
"input": {
"attributes": {
"values": [
{
"attributes": {
"sourceName": "HR Data",
"attributeName": "StartDate"
},
"type": "accountAttribute"
},
{
"attributes": {
"value": "2999-12-31"
},
"type": "static"
}
]
},
"type": "firstValid"
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"secondDate": {
"attributes": {
"input": "",
"expression": "now-730d"
},
"type": "dateMath"
},
"negativeCondition": "false",
"operator": "GT",
"positiveCondition": {
"type": "dateCompare",
"attributes": {
"firstDate": {
"attributes": {
"input": {
"attributes": {
"values": [
{
"attributes": {
"sourceName": "HR Data",
"attributeName": "StartDate"
},
"type": "accountAttribute"
},
{
"attributes": {
"value": "2999-12-31"
},
"type": "static"
}
]
},
"type": "firstValid"
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"secondDate": {
"type": "dateFormat",
"attributes": {
"input": {
"type": "static",
"attributes": {
"value": "01/01/2025"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
}
},
"negativeCondition": "false",
"operator": "GT",
"positiveCondition": "true"
}
}
},
"internal": false
}
1 Like
Thank you - this has worked the trick!
Much appreciated
1 Like