I use an external data collector written in C#. I send the data via the WIX POST http-function into a WIX Collection. There are two fields, one is a date field the other is a numeric field.
The external JSON array looks like this:
{
"dateTime": "2020-12-18T08:00:00Z",
"mbPercentagePerformance": 40.79
}
The WIX backend function looks like this:
export function post_insertFunctionName(request) {
let options = {"headers": {"Content-Type": "application/json"}};
// get the request body
return request.body.text()
.then( (body) => {
return wixData.insert("Collection-Name", JSON.parse(body));
} )
.then( (results) => {options.body = {"inserted": results};
return created(options);
} )
.catch( (error) => {options.body = {"error is": error};
return serverError(options);
} );
}
The problem is that the WIX collection can’t handle the ISO 8601 date format I’m passing in with the JSON array. The error in the collection is “The value does not match the field type Date and Time”.
Any help is appreciated!
Thanks