Hello!
I need to apply a timezone offset to the worker’s termination date so that we can process terminations at a specified time in the worker’s local timezone. However, it doesn’t look like we can reference a variable in the dateMath
primitive’s expression
field, so I’m at a bit of an impasse.
Ideally, I’d be able to use the dateTool Velocity function in a static transform to handle this, but it doesn’t look like that functionality has been added yet.
So far, the best solution I’ve been able to come up with is a static transform that combines the term date with the offset (which unfortunately requires a lookup table to convert the offset in hours to the properly-formatted string value; eg +5.5
to +5:30
).
{
"name": "terminationTime",
"type": "dateFormat",
"attributes": {
"inputFormat": "MM/dd/yyyy'T'HH:mm:ssX",
"outputFormat": "ISO8601",
"input": {
"type": "static",
"attributes": {
"termDate": {
"type": "firstValid",
"attributes": {
"ignoreErrors": "true",
"values": [
{
"attributes": {
"sourceName": "Workday",
"attributeName": "LAST_DAY_OF_WORK"
},
"type": "accountAttribute"
},
{
"type": "static",
"attributes": {
"value": "01/01/2100"
}
}
]
}
},
"offset": {
"attributes": {
"table": {
"0": "-0000",
"1": "+0100",
"8": "+0800",
"-5": "-0500",
"-6": "-0600",
"-8": "-0800",
"5.5": "+0530",
"default": "-0000"
},
"input": {
"attributes": {
"sourceName": "Workday",
"attributeName": "Workday_Timezone__c"
},
"type": "accountAttribute"
}
},
"type": "lookup"
},
"value": "${termDate}T23:59:59$offset"
}
}
},
"internal": false
}
Any other ideas about how to handle this?