Hello everyone,
Thank you for reading my question! I'm trying to update an existing feature layer with a file. However a field is changed during the update proces from a string to an int and changed the value without my intent.
I'll try to list my steps as thorough as possible
Download the zip file with two JSON files. The initial.json contains a FeatureCollection with a single feature containing a single property.
After that I upload the file to ArcGIS Online and create a hosted feature layer
This will work without any problems!
The second file insert_w_extra_column.json contains also a FeatureCollection with a different feature and also an extra property called BAG_ID. This property is formatted as a string and must remain a string. Before I upload the second json I add an extra column like this:
After adding the column I confirm that the column has been added and is empty because the first feature didn't contain the initial column.
Ok now for the final part. I update the existing feature layer with the second json
I select the first option "Add Features" and the let ArcGIS Online automatically match the columns for me.
Following the update action I get the green confirmation at the bottom of my screen.
Above you can see the final result of the update operation.
Some facts:
{
"type": "FeatureCollection",
"features": [
{
"geometry": {
"coordinates": [
3.6025124,
51.4391151
],
"type": "Point"
},
"properties": {
"VOLTAGE": "200Kv",
"BAG_ID": "0518100000338500"
},
"type": "Feature"
}
]
}
"properties": {
"VOLTAGE": "200Kv",
"ObjectId": 2,
"BAG_ID": "5.181E+14"
}
Why is this the case, this doesn't seem intended? It is kinda important for us as the ID gets lost in this way.
Any help or members willing to trying to replicate is greatly appreciated!
Solved! Go to Solution.
Sorry to hear you're experiencing this issue. I was able to reproduce it with the attached zip file as well.
I would encourage you to open up a ticket with Esri support. This seems like a bug since the value is being incorrectly displayed in scientific notation after updating the data, particularly since the data is initially being published with the value that you would expect (0518100000338500).
In the meantime, if it's possible for your workflow I would suggest using a different file type for your Update Data operation. If I take the data from your JSON file and publish/update with an XLSX file instead (attached below), the data will insert as expected with no conversion to scientific notation.
Best,
Taylor
Ok I just made an easier test case with the same output. Uploading the second json (with the extra column) twice. First as the definition layer and then as the update. See my screen recording here:
Sorry to hear you're experiencing this issue. I was able to reproduce it with the attached zip file as well.
I would encourage you to open up a ticket with Esri support. This seems like a bug since the value is being incorrectly displayed in scientific notation after updating the data, particularly since the data is initially being published with the value that you would expect (0518100000338500).
In the meantime, if it's possible for your workflow I would suggest using a different file type for your Update Data operation. If I take the data from your JSON file and publish/update with an XLSX file instead (attached below), the data will insert as expected with no conversion to scientific notation.
Best,
Taylor
Hi Taylor,
Thank you for replying and confirming this bug with your reproduction! We've found another work-around as well. I'll share it here for other readers:
I've also submitted an official bug report. For now i'll just close this topic