Esri / crowdsource-polling

Provides a means for citizens to provide feedback to their governments
Apache License 2.0
20 stars 15 forks source link

Receive “Error: Cannot convert a value of type ‘java.lang.String’ to ‘TIMESTAMP’ when supplying a date value in the application #131

Closed jfrygeo closed 8 years ago

jfrygeo commented 8 years ago

When supplying a Date Value I receive the error:

“Error: Cannot convert a value of type ‘java.lang.String’ to ‘TIMESTAMP’

@ACueva believes there is an issue with ArcGIS Server and the way it resolves the time from the Crowdsource Polling application.

allisonmuise commented 8 years ago

@MikeTschudi : Is this the same as #129 , or is it a separate issue?

MikeTschudi commented 8 years ago

Separate. #129 is an enhancement to allow time info to be specified along with date info in the comment form, and the result is still a single JavaScript date object.

This issue is a low-level interaction problem between the JSAPI and a particular database: the API is sending dates as a string and the database is rejecting this format. So far, it only seems to work with epoch-style numeric dates. @ACueva and I are trying to diagnose it.

MikeTschudi commented 8 years ago

The JSAPI's applyEdits function uses dojo.toJson to JSONify a JavaScript Date object for sending to a feature service. The result is a string, which our feature services generally accept in addition to the ArcGIS REST standard of milliseconds. But because the string format is not part of the standard, it is possible for there to be backend DBs that do not accept the string, as John found.

We'll approach fixing this in two ways:

  1. Change the app to convert Date objects to milliseconds for applyEdits to get a fix out quickly
  2. Change applyEdits to convert Date objects to milliseconds to help future users of the JSAPI past the problem
MikeTschudi commented 8 years ago

App updated; applyEdits change under consideration for 3.17 JSAPI

jfrygeo commented 8 years ago

@MikeTschudi Since the Crowdsource Polling Application is part of the out-of-the box web application templates distributed with Portal for ArcGIS, will future releases of portal have this updated functionality?

@elinz @jrweakland

MikeTschudi commented 8 years ago

The Crowdsource Polling update will be part of future releases--it's already been checked into the web application templates repository.

allisonmuise commented 8 years ago

4664 in arcgis-js-api

dlengton commented 6 years ago

"[{\"id\":0,\"addResults\":[{\"objectId\":null,\"globalId\":null,\"success\":false,\"error\":{\"code\":10500,\"description\":\"Cannot convert a value of type 'java.lang.String' to 'TIMESTAMP'.\"}}]}]"

Get the same error when using Survey123 browser connected to an Enterprise Portal The same Survey works when collecting through the Survey123 field application

allisonmuise commented 6 years ago

@dlengton I suggest reaching out to Esri Support Services or your local distributor for help with this issue. They will have better capacity to help troubleshoot, especially where you are seeing this issue across multiple apps.