Unable to Modify Empty Hosted Feature Layer Attributes to Allow Nulls

1578
5
Jump to solution
01-21-2021 08:08 AM
luckachi
Occasional Contributor III

Hello, I have a hosted feature layer that is currently empty as it is being developed for use with a GeoForm. I'd like to update a few of the fields to allow for null values but I am unable to do so. Is there any way to make these changes without having to delete the field every time a change needs to be made?

Using ArcGIS Pro does not work (Error 000664: Invalid input: This type of dataset is not supported. ) and updating through the REST service does not work even though it says it succeeded. 

0 Kudos
1 Solution

Accepted Solutions
PeterKnoop
MVP Regular Contributor

I ended up using the ArcGIS API for Python, and for each field for which I needed to enable Nulls:

  • Add a new field with Null enabled, and the rest of the properties identical to the field it replaces (such as your Domains.)
  • Calculate the new field from the old field (dealing with values that you might need to change to Null, if needed.)
  • Delete the old field.
  • Rename the new field to the old field's name.

Repeat as needed for all your layers and fields for which you want to enable Null values.

View solution in original post

5 Replies
PeterKnoop
MVP Regular Contributor

I recently encountered this as well, and found this Esri Technical Support document that explained the situation.

Problem: Unable to modify the nullable property of a hosted feature service from the REST endpoint

0 Kudos
luckachi
Occasional Contributor III

Peter - what would be the easiest method for republishing or overwriting a hosted feature layer - use the feature class to feature class tool? I'd prefer to not have to redo the domain values, etc as one field contains 60+ options.

0 Kudos
PeterKnoop
MVP Regular Contributor

I ended up using the ArcGIS API for Python, and for each field for which I needed to enable Nulls:

  • Add a new field with Null enabled, and the rest of the properties identical to the field it replaces (such as your Domains.)
  • Calculate the new field from the old field (dealing with values that you might need to change to Null, if needed.)
  • Delete the old field.
  • Rename the new field to the old field's name.

Repeat as needed for all your layers and fields for which you want to enable Null values.

luckachi
Occasional Contributor III

Ah, okay. Thank you - I'd probably have to go a different route only because I have zero experience with python.

I am surprised that this can't be changed right from ArcGIS Pro / REST service considering the layer has no data. 🤔

0 Kudos
PeterKnoop
MVP Regular Contributor

You could perform the same steps manually in Online or Enterprise via the user interface. Or, via the REST API. I had a bunch of similar layers and fields to fix, so I automated the process using an ArcGIS Notebook.