salam1
(Shajedul Alam)
March 3, 2025, 7:34pm
1
Hello,
I am writing a transform to set the value true or false based on the Termination date and Termination category account attribute from workday.
I am getting an exception while calculating the value for this identity attribute.
Exception:
There was an exception while calculating the value for this attribute. Error during transformation for attribute: workdayemailterm (Transform ID: Termination Trigger based on category workday test) Cause: Text ‘’ could not be parsed at index 0
Transform:
{
"id": "45ce75f5-ec6a-432d-a7e3-407d1eb6b633",
"name": "Termination Trigger based on category workday test",
"type": "static",
"attributes": {
"terminationCategory": {
"attributes": {
"sourceName": "Workday Sandbox",
"attributeName": "TERMINATION_CATEGORY__c"
},
"type": "accountAttribute"
},
"dateCompare": {
"attributes": {
"firstDate": {
"attributes": {
"addition": {
"attributes": {
"sourceName": "Workday Sandbox",
"attributeName": "TERMINATION_DATE"
},
"type": "accountAttribute"
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"secondDate": "now",
"operator": "lte",
"positiveCondition": "true",
"negativeCondition": "false"
},
"type": "dateCompare"
},
"value": "#if($dateCompare == 'true' && $terminationCategory == 'Voluntary')true#{else}false #end"
},
"internal": false
}
I am not entirely sure why it is failing. Is it not able to fetch the account attribute from workday sandbox source?
salam1
(Shajedul Alam)
March 3, 2025, 7:57pm
2
Ah I see why it is giving the error. Looks like the Termination date field is usually empty until someone resigns or terminated.
Wondering if there a way to better way to do this.
suresh4iam
(Suresh Kumar Palanisamy)
March 3, 2025, 9:11pm
3
You can use firstValid transform to handle this scenario with future termination date when it is empty or null. Sample below,
{
"id": "45ce75f5-ec6a-432d-a7e3-407d1eb6b633",
"name": "Termination Trigger based on category workday test",
"type": "static",
"attributes": {
"terminationCategory": {
"attributes": {
"sourceName": "Workday Sandbox",
"attributeName": "TERMINATION_CATEGORY__c"
},
"type": "accountAttribute"
},
"dateCompare": {
"attributes": {
"firstDate": {
"attributes": {
"input": {
"attributes": {
"values": [
{
"attributes": {
"attributeName": "TERMINATION_DATE",
"sourceName": "Workday Sandbox"
},
"type": "accountAttribute"
},
"12/31/9999"
],
"ignoreErrors": "true"
},
"type": "firstValid"
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"secondDate": "now",
"operator": "lte",
"positiveCondition": "true",
"negativeCondition": "false"
},
"type": "dateCompare"
},
"value": "#if($dateCompare == 'true' && $terminationCategory == 'Voluntary')true#{else}false #end"
},
"internal": false
}
1 Like
if either of the attributes that you are parsing into the “value”: “…” are null ($dateCompare or $terminationCategory), then the expression will fail. Wrap each one in firstValid transforms and set a default expression.
2 Likes
sup3rmark
(Mark Corsillo)
March 4, 2025, 3:05pm
5
Suresh Kumar Palanisamy:
"terminationCategory": {
"attributes": {
"sourceName": "Workday Sandbox",
"attributeName": "TERMINATION_CATEGORY__c"
},
"type": "accountAttribute"
},
This is missing the firstValid on the TERMINATION_CATEGORY__c
attribute.
2 Likes
salam1
(Shajedul Alam)
March 4, 2025, 5:29pm
6
Thank you so much! if attribute “Termination_Category__c” is empty, will it still work?
salam1
(Shajedul Alam)
March 4, 2025, 5:33pm
7
Ah so it needs firstValid for both “TERMINATION_CATEGORY__c” and “TERMINATION_DATE”
1 Like
suresh4iam
(Suresh Kumar Palanisamy)
March 4, 2025, 5:43pm
8
No it will not work, you need to add firstValid transform for both.
sup3rmark
(Mark Corsillo)
March 4, 2025, 5:51pm
9
yep. i would suggest marking @phil_awlings ’s comment as the correct solution, as he was the first to correctly recommend using firstValid transforms on both attributes.
1 Like
system
(system)
Closed
May 3, 2025, 5:51pm
10
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.