Within a given JSON I have to adapt Dates to an ISO format, and I do not get the right approach.
This is my input json:
{
"itemNo": "1010333",
"productNo": "myProduct",
"description": "myItem-01",
"attributes": [
{
"identifier": "FIRST_DATE",
"type": "attribute",
"DataType": "DATE",
"values": [
{
"value": "05.12.2022"
}
]
},
{
"identifier": "mytimestamp",
"type": "attribute",
"DataType": "DATEANDTIME",
"values": [
{
"value": "17.07.2023 13:13:10"
}
]
}
]
}
and this is the desired output
when DataType is DATE => parse String of value to yyyy_MM-ss
when DataType is DATEANDTIME => parse String of value to yyyy_MM-ss’T’hh:mm:ss
{
"itemNo": "1010333",
"productNo": "myProduct",
"description": "myItem-01",
"attributes": [
{
"identifier": "FIRST_DATE",
"type": "attribute",
"DataType": "DATE",
"values": [
{
"value": "2022-12-05"
}
]
},
{
"identifier": "mytimestamp",
"type": "attribute",
"DataType": "DATEANDTIME",
"values": [
{
"value": "2023-07-17'T'13:13:10"
}
]
}
]
}
Unfortuantely I cannot provide the slightest approach here, because I do not know wether to start with “shift” or with “modify-overwrite-beta”, due to the fact, that all depends on the DataType.
If it is not a good idea to transform Dates within JOLT I can try it with another nifi processor.Currently my aim is, to proceed as much as possible with JOLT. Thanks in advance for your opinion.