I have an asset ID field that is a String. The values are unique. Sometimes the values take the form 1-2017-10. Despite being a String when I publish this layer as a Hosted Feature Layer and view the attribute table anything that looks like a date is formatted as a date (e.g. 1/10/2017 12:00:00 AM).
How can I prevent this from happening?
I have tried to reproduce this issue, but unfortunately, I am not experiencing the same behaviour. If the data is not sensitive, could you share a sample of it with me?
If not, could you confirm by reviewing the Fields of the layer within ArcGIS Pro, if the Asset ID Data Type is "Text"? E.g.:
Please do keep me in the loop and I will be happy to help further.
Thanks for the reply. The data is coming from a GeoJson. I've then published it as a hosted feature layer. If I bring that hosted feature layer into ArcGIS pro the Data Type is indeed Text. However, when I view the data in ArcGIS online (and in Pro) the example 1-2017-10 and those like it are converted to date format. I should add that viewing the data type in ArcGIS online it still states a String.
I have tried testing this same process with a GeoJSON file also, and I am still unable to replicate the same behaviour. I have seen issues previously, where publishing a GeoJSON as a feature layer, but with a string field where an integer is the first record (followed by alphanumeric values), which doesn't sound the same as this scenario.
In terms of your data, could you please share:
In answer to your questions:
From this it would seem the problem lies with uploading a GeoJson to AGOL and then publishing it as a feature layer. Why would that process auto format values? And are there any settings that could be changed to prevent it happening?