Question
Pegasystems Inc.
AU
Last activity: 13 Oct 2021 9:17 EDT
JSON ISO Date not converted to Pega Date in JSON Data Transform
We have a JSON payload we receiving via a REST Service. We dump the entire payload to a clipboard property and then use a JSON Data Transform to deserialize the JSON to the Clipboard in the Service Activity.
The JSON ISO date is in format "YYYY-MM-DD"
The receiving Pega property is of Date format "YYYYMMDD"
My expectation would be that the JSON Data Transform converts the ISO format to the Pega internal date format. However, after executing the Data Transform the Pega date property contains a value of "YYYY-MM-DD" which is invalid and I'm surprised this doesn't generate an exception. When serializing the date format using a JSON Data Transform the date behaviour can be selected in the Settings tab. I'm not sure why this doesn't work for deserializing ISO dates.
Has anyone experienced the same behaviout and if so how did you resolve it?
Some screenshots to illustrate this issue:
JSON payload (abbreviated):
{"controller":{"postingDate":"2021-05-07"}}
JSON Data Transform (see postingDate):
Clipboard after deserialization (see value in postingDate property):
We have a JSON payload we receiving via a REST Service. We dump the entire payload to a clipboard property and then use a JSON Data Transform to deserialize the JSON to the Clipboard in the Service Activity.
The JSON ISO date is in format "YYYY-MM-DD"
The receiving Pega property is of Date format "YYYYMMDD"
My expectation would be that the JSON Data Transform converts the ISO format to the Pega internal date format. However, after executing the Data Transform the Pega date property contains a value of "YYYY-MM-DD" which is invalid and I'm surprised this doesn't generate an exception. When serializing the date format using a JSON Data Transform the date behaviour can be selected in the Settings tab. I'm not sure why this doesn't work for deserializing ISO dates.
Has anyone experienced the same behaviout and if so how did you resolve it?
Some screenshots to illustrate this issue:
JSON payload (abbreviated):
{"controller":{"postingDate":"2021-05-07"}}
JSON Data Transform (see postingDate):
Clipboard after deserialization (see value in postingDate property):
Property rule:
Property Advanced tab: