Description
In ArcGIS Online, it is sometimes necessary to edit the domain values for data precision. However, attempting to edit the domain values of a hosted feature layer is not possible as the Edit button is not available.
The image below shows that the List of Values (Domain) Edit button is not available.
Cause
This issue occurs when a hosted feature layer view is created from the hosted feature layer using the Join Features tool in Map Viewer Classic. When a hosted feature layer view is created, the hosted feature layer schema is locked to ensure the data in the view corresponds to the hosted feature layer source data.
Solution or Workaround
To enable editing for the domain values, follow either of the workarounds provided below.
Remove the hosted feature layer view from ArcGIS Online
- Log in to ArcGIS Online account.
- Click Content > My Content.
- Browse to and check the check box of the hosted feature layer view created through the Join Features tool.
- Click Delete.
- In the Delete window, click Delete.
Update the service definition at the hosted feature layer view REST endpoint
Warning:
The instructions below include making changes to essential parts of your hosted feature layer view. It is recommended to make a copy of the original JSON before proceeding.
Esri cannot guarantee results from incorrect modifications while following these instructions. Therefore, use caution and proceed at your own risk. Any problems encountered as a result of making these modifications are not supported by Esri Technical Support.
- In ArcGIS Online, open the desired hosted feature layer view.
- On the Overview page, scroll down to locate the URL section.
- Click View to open the layer's REST endpoint window.
- In the ArcGIS REST Services Directory window, click Admin.
- In the ArcGIS REST Services Directory window, scroll down and click Update Definition.
- In the Update Service Definition text box, search for the hasStaticData parameter (Press Ctrl + F, and search for hasStaticData) and change the value to false.
{
"hasStaticData" : false,
}
- Search for the SourceSchemaChangesAllowed parameter (Press Ctrl + F, and search for sourceSchemaChangesAllowed), and change the value to true.
{
"sourceSchemaChangesAllowed" : true,
}
- Search for the lastEditDate, schemaLastEditDate, and dataLastEditDate parameters (Press Ctrl + F, and search for lastEditDate, schemaLastEditDate, and dataLastEditDate) and replace the number values with quote marks as below:
"lastEditDate" : '',
"schemaLastEditDate" : '',
"dataLastEditDate" : ''
- Click Update Service Definition to save and return to the previous page.
The List of Values (Domain) Edit button is now available.
- After editing the domain values, reset the hasStaticData parameter in Step 6 to true, and the SourceSchemaChangesAllowed parameter in Step 7 to false. Repeat Step 8 to 9 to lock the source data layer.