Problem Editing AGOL Hosted Feature Layer After Delete Field

512
5
01-07-2019 08:05 AM
Highlighted
Occasional Contributor

Hi.  I'm wondering if we missed a step when updating the fields in a hosted feature layer we're editing.  We deployed the hosted feature layer using a file geodatabase and ArcMap.  After we added a few features, we decided we didn't need one of the fields so we deleted it through AGOL.  Now, when we try to create a new feature we get an error.  Well, when editing through the AGOL map viewer, there is no error; the feature just disappears from the map and is not added to the layer.  In ArcGIS Pro, an actual error is captured - "failed to create new feature(s).  General function failure [Invalid column name 'Type'.]"

"Type" is the field we deleted.

The field does not show up anywhere (e.g. popups, REST point, Data tab, exported).  

Any information or ideas are appreciated to help us understand what's happened (so it doesn't happen again) and how to fix this data.set.


Thanks. 

5 Replies
Highlighted
Occasional Contributor III

Do you know if you have any definitionExpression on the layer that reference the "Type" field? deleting a field that is referenced by the definition expression would cause issue like what you are seeing. Also do you know if updating a feature works? 

I have just tried deleting a field and I have no issue adding features. So it might be either related to the definitionExpression or server cache issue. Updating anything in the layer would clear the cache if it is cache issue.

Also would be good to know how you deleted the field? did you use the UX or from the REST admin API?

You can always delete a field using the layer admin API:

rest/admin/services/<myService>/FeatureServer/<layerId>/deleteFromDefinition

{

    "fields" : [

    {

       "name" : "<fieldName"

   }

  ]

}

  

Thanks

Khaled Hassen

Online Feature Service Dev Lead

Reply
0 Kudos
Highlighted
New Contributor II

Definition expression? not sure what this is? but I have the same problem, i would like to eliminate a field because it is no longer useful, but I get the same error message

Reply
0 Kudos
Highlighted
Occasional Contributor II

Did anyone every figure out a solution for this error? We have ran into this on multiple occasions and have not been able to fix it short of republishing the entire layer (not ideal). There is no way to reliably reproduce it. But it does happen. And there is no def expression on these layers for me.  

Reply
0 Kudos
Highlighted
Occasional Contributor III

Will be good if you can send the layer url. The most common issue is that you have set a definition expression on the layer and then you have deleted the field referenced by that expression. 

Khaled Hassen

Online Feature Service Dev Lead

Reply
0 Kudos
Highlighted
Occasional Contributor II

Unfortunately we had to republish the layer to fix this so I don’t have a broken example at the moment. I can verify we did not have a Def Expression set on the item. Next time it happens I will try and reach out with an example.

Reply
0 Kudos