Error editing data after dropping field from hosted feature service

2274
5
Jump to solution
04-16-2020 01:36 PM
Trippetoe
Occasional Contributor III

I have an AGOL Hosted Feature Service that's been around for a long time. Several maps and apps have been built on the feature service.

Today, i deleted one field from the service (field name = 'HearingDate'). To delete the field, I used the AGOL Item > Data > Table page; clicked the field name, then selected Delete. The field seemed to be deleted as expected:

  • The field no longer appears in the Item > Data Table or Fields view
  • When I view the item's REST browser page, the field is not present
  • When I open the 'Configure Popup' dialog in a web map, the field is not listed
  • When I open the WAB 'Edit or create item' widget, the field is not present.

After dropping the field, i am unable to edit data in the table:

  • I tried editing directly in the Items > Data > table grid view
  • I tried editing directly in a web map
  • I tried adding map with the layer to a WAB and use the Edit widget
  • I tried editing in the REST browser for the service.

All those efforts result in the following response:

{"addResults":[],"updateResults":[{"objectId":51099,"uniqueId":51099,"globalId":null,"success":false,"error":{"code":1000,"description":"Invalid column name 'HearingDate'."}}],"deleteResults":[]}

Any ideas about what's going on?

Here is a typical update request against the feature service. Note that the phrase 'HearingDate' is not part of the request.

[{"attributes":{"OBJECTID":51099,"CaseNumber":"6705943754","DateReceived":1532735978738,"Complainant":"test 105","ComplainantPhone":null,"ComplainantEmail":null,"Address":"Test Address","City":"Test city","IncidentDescription":"testing","SiteStatusDate":1532735978738,"DispositionDate":1532735978738,"DispositionNotes":null,"TagNumber":null,"TagIssuedDate":null,"IgaPartner":null,"Icomp":null,"PostingDate":null,"Latitude":null,"Longitude":null,"CitationNumber":null,"RespondentName":null,"IssuedDate":null,"ResponseDate":null,"Costs":null,"TotalCitationAmount":null,"JudgementDate":null,"HearingsOfficerJudgement":null,"CitationComments":null,"AsbestosSampleDate":null,"AsbestosSampleCount":null,"CaseAgeInDays":621,"DataApprovedDate":null,"SiteStatus":"Dirty","CleanupTime":null,"HasEvidence":"No","Disposition":"Open","CaseType":"Report","WasteSource":null,"DumpLocation":null,"EnvironmentalSensitivity":null,"DumpSize":null,"IsFreeBox":null,"CampersPresent":null,"PersonalProperty":null,"IsActive":"Yes","SuspectAsbestos":"No","ReportedMethod":"Website","County":"testing","AssignedCrew":null,"InvestigatingOfficer":null,"CitationResponse":null,"AsbestosSampleResults":null,"DataApproved":null,"SiteNotes":null,"IsTheftOfService":"No","LocationDetails":null,"ReferredToAgency":null,"ReportID":"RPT0Test","ReportStatus":"Received","ReportStatusDate":1532735978738,"ReportStatusNotes":null,"ReportedCount":1,"ReporterHasEvidence":"No","ReporterFirstContactedDate":null,"ReporterContactNotes":null,"reporterEvidenceDetails":"","EditDate_1":1534591020000}}]

1 Solution

Accepted Solutions
Trippetoe
Occasional Contributor III

Josh from Esri tech support gave me the solution to problem.  I needed to disable/save/enable/save all the 'Editing' settings for the hosted feature layer. From Josh: 

The editing setting "Keep track of created and updated features " creates a back end table that lists out all of the fields in the feature layer. When deleting fields, this table does not always update. When the table in the feature layer and this back end table do not match, it disallows editing capabilities. Turning this option on and off  causes the table to refresh and update with the correct data.

View solution in original post

5 Replies
Trippetoe
Occasional Contributor III

Josh from Esri tech support gave me the solution to problem.  I needed to disable/save/enable/save all the 'Editing' settings for the hosted feature layer. From Josh: 

The editing setting "Keep track of created and updated features " creates a back end table that lists out all of the fields in the feature layer. When deleting fields, this table does not always update. When the table in the feature layer and this back end table do not match, it disallows editing capabilities. Turning this option on and off  causes the table to refresh and update with the correct data.
LeonS
by
Occasional Contributor III

This worked for me.  Thanks for sharing!

0 Kudos
by Anonymous User
Not applicable

This also solved my issue, thank you for sharing!

0 Kudos
DataOfficer
Occasional Contributor III

I am experiencing a similar issue, after doing the following:

 

1. Loading a hosted feature layer in to ArcGIS Pro

2. Deleting unused fields via the attribute table in ArcGIS Pro

3. Trying to carry out editing / use Calculate Field on other fields. I get the following error in ArcGIS Pro:

ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds.
General function failure [Error code: 1000. Description: Invalid column name 'Column2'.
Invalid column name 'F39'.
Invalid column name 'F2016_cond'.
Invalid column name 'F41'.. ]
Failed to execute (CalculateField).
Failed at 05 May 2023 15:49:51 (Elapsed Time: 2.10 seconds)

I have tried the suggested fix of disabling, saving, re-enabling and saving the following settings in the AGOL hosted feature layer, but to no avail. I have also tried removing and re-adding the layer to the ArcGIS Pro project in between these steps, and also closing and reopening the project. Still no luck.

Keep track of changes to the data (add, update, delete features).
Keep track of who edited the data (editor name, date and time).
I have also tried running Calculate Field in Python and SQL and still no luck.
alex_friant
Occasional Contributor II

I rebuilt the feature template using the Map Classic (why isn't this available in the new map yet, it's August 2023??) but that didn't work. I tried turning on/off the "Keep track of changes to the data (add, update, delete features)." but it didn't fix the problem. I then tried turning off/on all of those features (Enable editing, Keep track of changes..., Keep track of who... Enable Sync... ). I also rebuilt the Spatial Index (not sure if necessary). 

Then it finally started working again.