dpowers1
(David Powers)
1
I have this transform below and want it to handle the end date if it is blank and not fail. “name”: “SB_NEXTDAYPROCESSING”,
"type": "dateMath",
"attributes": {
"input": {
"type": "firstValid",
"attributes": {
"values": \[
{
"type": "dateFormat",
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"sourceName": "ARHSB-Passport Database",
"attributeName": "End_Date"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
}
}
\]
}
},
"expression": "+36h"
},
"internal": false
}
ksbagade
(Kartik Bagade)
2
Hi @dpowers1
Try using a first valid transform alongside your accountAttribute transform like this:
{
"type": "dateMath",
"attributes": {
"input": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "dateFormat",
"attributes": {
"input": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "ARHSB-Passport Database",
"attributeName": "End_Date"
}
},
"12/31/9999"
],
"ignoreErrors": false
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
}
}
]
}
},
"expression": "+36h"
},
"internal": false
}
Let me know if this helps!
Tursun
(Shawn Tursun)
3
Hi @dpowers1
{
"name": "SB_NEXTDAYPROCESSING",
"type": "firstValid",
"attributes": {
"ignoreErrors": true,
"values": [
{
"type": "dateMath",
"attributes": {
"input": {
"type": "dateFormat",
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"sourceName": "ARHSB-Passport Database",
"attributeName": "End_Date"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
}
},
"expression": "+36h"
}
},
""
]
},
"internal": false
}
Basically transform is doing firstValid outer transform and ignoreErrors:true. Otherwise a blank end_date can still cause dateFormat/dateMath to fail.
Thanks
dpowers1
(David Powers)
4
Thank you. I tried that and it didn’t fail when there was no end date
dpowers1
(David Powers)
5
Thank you. I tried that and it didn’t fail when there was no end date
ksbagade
(Kartik Bagade)
6
I’m glad that worked for you!
Have a nice day 