Problem: Changing subtype fields does not populate the expected fields in ArcGIS Online
Subtypes are records in a table or feature class that have been grouped based on an attribute field. Subtypes are implemented by creating coded values and, therefore, must be associated with fields of the data type Short or Long Integer. These integer values each represent a feature in the subtype. For example, the following codes in a subtype named RoadClass could represent valid classes in a feature class for streets:
- 0 - Local Streets
- 1 - Secondary Streets
- 2 - Main Streets
Each subtype can have its own set of default values. In the above example, the local streets subtype could have the default value for a speed limit attribute set to 25 miles per hour, while the default value for the main streets subtype could be 35 miles per hour. Whenever a local street is added to the streets feature class, its speed limit attribute is automatically set to 25 miles per hour. Whenever a main street is added, the speed limit is set to the default of 35 miles per hour.
However, when modifying existing features in ArcGIS Online, editing the subtype field(s), the default values for the edited field do not get applied in the same manner as they do in ArcGIS Desktop. In the web map, when the subtype value is changed from the drop-down, the accompanying field is not automatically updated with the default value; it is instead left blank and requires the editor to select one of the available options.
Solution or Workaround
There are three options that can be used as an alternative to this behavior.
- Use the existing feature templates to create new features based on the default, pre-configured feature templates. If the feature templates were created prior to the publishing process, the attribute values should have been created with the default domain and subtype values that are set when adding new features based on that specific feature template.
Note: Feature templates define all the information required to create a feature: the layer where a feature is stored, the attributes a feature is created with, and the default tool used to create that feature. A layer can have multiple templates associated with it, where each template has different default settings. For example, if there is a roads layer with classifications of freeway, major highway, and local road, there could be three different templates, with each one having a different default attribute for the type of road. This makes it easier to create the new type of road needed from the start.
Once the feature templates are available, new features can be created with the appropriate templates, old features can be deleted, and attribute values can be adjusted as needed.
- Configure and assign domains to each individual field and republish the service. Follow the steps below to create domains and assign them to the individual fields in ArcMap before publishing to ArcGIS Online.
- In the Catalog tree in ArcMap, right-click the table or feature class with which to associate domains.
- Click Properties.
- Click the Fields tab.
- Click the field to associate with the domain.
- Click the field next to Domain, click the drop-down arrow, and click the domain to associate with the field. (Only those domains that apply to this field type are displayed in the list.)
- Click Apply and OK.
- Publish the feature class to ArcGIS Online again. The drop-down list for domains are now available when editing the attributes in the feature's pop-up window.
- Edit the domains and subtypes in the Data tab of the item details page.
- In ArcGIS Online, go to My Content, and select the intended feature layer with domains and subtypes.
- Click the arrow beside the feature layer name, and select View item details from the drop-down list.
- In the item details page of the feature layer, click the Data tab.
- Double-click a value of the domains or subtypes in the table to edit it.
- A quick tour of attribute domains
- About feature templates
- Associating default values and domains with tables and feature classes