I need to change a date from YEAR to a fixed YYYY-MM-DD
only if the value of the year is not null.
At the moment I have this
[
{
"operation": "modify-overwrite-beta",
"spec": {
"Passing?": "=concat(@(1,Passing),-01-01'"
}
}
]
Input:
{
"Passing": "2022",
"Comments": "NotMentioned",
"Team": "2",
"modified_date": "2023-01-27 13:41:39",
"Profile": "DM",
"JobRole": "Tester"
}
And the Output I'll like is
{
"Passing": "2022-01-01",
"Comments": "NotMentioned",
"Team": "2",
"modified_date": "2023-01-27 13:41:39",
"Profile": "DM",
"JobRole": "Tester"
}
This is currently working fine but when I have a null value in Passing i get this, that I want to avoid.
{
"Passing": "null-01-01",
"Comments": "NotMentioned",
"Team": "2",
"modified_date": "2023-01-27 13:41:39",
"Profile": "DM",
"JobRole": "Tester"
}
I need to keep the "Passing" equal to "null" if there is no year in it.