Problem occurring while parsing attribute of type Date and Time. Error: This isnt allowed by the schema.
Hello all, In my application, I am using call REST service in microflow and displaying API response attributes in page. Developed the Domain Model using the JSON of API response. Among the attributes, one is of type “Date and Time” and while calling the API getting the error as A problem occurred parsing attribute 'CreationDate' of object of type 'MyFirstModule.Header'. The value was '/Date(1508457600000)/'. This isn't allowed by the schema. Could someone tell me how can I solve this error and get the Date displayed correctly. Thanks in advance.
The Date value cannot be directly parsed and stored using the import mapping. So I would suggest to change attribute type from DateTime to a simple string and store the date value received from REST API as a string.
When you have the date as a string, parse it yourself later. Below is documentation link for complete date parsing options. Just adjust parameters of function with format of your date to store it as a Mendix DateTime attribute https://docs.mendix.com/refguide7/parse-and-format-date-function-calls