To improve data quality, you can provide editors a list or range of acceptable values for fields in your hosted feature layers. For example, say your hosted feature layer stores information about city-owned trash containers placed throughout the city. Your city uses plastic and aluminum bins with capacities from 15 to 50 gallons. To prevent editors from typing incorrect values and avoid typos, you could create a pick-list for the material field that includes the two values—plastic and aluminum—and set a minimum value of 15 and maximum value of 50 for the bin's capacity field. Creating a list of values editors can use to populate the field is useful if you have a limited number of possible values.
As the owner of a hosted feature layer or a member of the default administrator role, you can create a list of suggested attribute values for text and numeric (integer and double) fields. You can also define the possible minimum and maximum values for numeric fields.
Create a list of values
When you define a list of values, you set a code—the value stored in ArcGIS Online—and a label—the value users see in the values list and attribute table when they view it in ArcGIS Online.
If the field allows null values, the list of values will contain an -empty- option in addition to the values you define.
Creating a list of values that editors can use to populate the field is useful if you have a limited number of possible values.
Follow these steps to create a list of valid values for a field in a hosted feature layer:
- On the hosted feature layer's item page, click the Data tab to open the attribute table.
- Click Fields.
- If your hosted feature layer contains more than one sublayer, use the Layer drop-down menu to choose the sublayer that contains the field you need.
- Click the field's display name to open settings for the field.
- Click Create List.
You can create a list of possible values before there is data in the layer. However, if the field contains values when you create the list, you can click Generate List to populate the list with the unique values from the field. The number of times that value appears in the field is shown in the initial list.
Note:
Only the first 1,000 unique values in the table will appear when you click Generate List.
- Type values for each possible code and label for a field.
- Code—The code is stored in the attribute table and must be supported for the data type set for the field. For example, if the field is an integer field, you cannot have a code that uses alphabetical characters. In some cases, the code value is an abbreviated form of the information. For example, for the materials field in the trash bin example, the codes might be PL and AL.
- Label—The label is a unique text value that appears in the values list and attributes table. For the PL code, the label is plastic and for the AL code, the label is aluminum. The label also allows you to show more information than the data type for the field allows. For example, if the trash bin layer also has an integer field that stores bin height, the code for a 1 meter bin would be 1, but you can set the corresponding label to 1 m or 1 meter.
- Click Add to define more values for the field.
Values appear in the list in the same order as on the List of Values page.
- To change the order, drag the label and code pair up or down in the list.
- To delete a defined value, click the Delete button .
- When you finish defining the list of possible values for a field, click Save.
Edit a list of values
You can change the contents and appearance of an existing list of values. For example, you may find you have more aluminum than plastic bins in the city and you want that to be the first value editors see in the list. Or you may find that additional values are needed. For example, if your list of trash bins needs to allow for steel bins, you can edit the list to add this new value.
You can also change existing label values in the list. When you do, users see the new label when they view the list of values and the attribute table in ArcGIS Online.
Caution:
You can change existing code values, but this is not recommended if there is data in the field that is using the code. When you change a code value, existing attribute values are not updated in the table. You can also delete a value from the list, but existing values in the attribute table will appear with the code rather than the label. For example, if you delete the plastic,PL value, people will see PL when they view the attribute table in ArcGIS Online.
Follow these steps to edit a list of valid values for a field in a hosted feature layer:
- On the hosted feature layer's item page, click the Data tab to open the attribute table.
- Click Fields.
- If your hosted feature layer contains more than one sublayer, use the Layer drop-down menu to choose the sublayer that contains the field you need.
- Click the field's display name to open settings for the field.
- Click Edit next to List of Values (Domain).
- Optionally perform any of the following edits:
- Drag a label or code pair to a new location in the list to reorder them.
- Click Add to define more values for the field.
- To change a label, type a new one in the Label field.
- Click the Delete button to remove a value from the list.
- When you finish defining the list of possible values for a field, click Save.
Delete a list of values
If it no longer makes sense to restrict the values editors provide when adding or updating an attribute value—for example, if you decide that recording accurate bin material is not important—you can delete the list of values. Editors will no longer be presented with a value list when performing future edits.
Caution:
Existing values in the attribute table remain in the table but will appear with the code rather than the label. For example, if you delete the list of values from the material field, people will see PL and AL when they view the attribute table in ArcGIS Online.
Follow these steps to delete a list of values:
- On the hosted feature layer's item page, click the Data tab to open the attribute table.
- Click Fields.
- If your hosted feature layer contains more than one sublayer, use the Layer drop-down menu to choose the sublayer that contains the field you need.
- Click the field's display name to open settings for the field.
- Click Edit next to List of Values (Domain).
- Click Delete List.
- Click OK to confirm you want to delete the list of values.
Set minimum and maximum values
You can define a range of valid minimum and maximum values for numeric fields. When editors add or update a value for the field, they receive a warning if the value they type is outside the range. If they continue with the edit, the field reverts to the previous value.
Follow these steps to set a minimum and maximum value for an integer field:
- On the hosted feature layer's item page, click the Data tab to show the attribute table.
- Click Fields.
- If your hosted feature layer contains more than one sublayer, use the Layer drop-down menu to choose the sublayer that contains the field you need.
- Click the field's display name to open settings for the field.
- Click Edit next to Minimum / Maximum Value.
- Type the lowest value allowed in the Minimum field.
- Type the highest value allowed in the Maximum field.
- When you finish defining the list of possible values for a field, click Save.
You can increase or decrease the range of valid values for a numeric field. If you decrease the range, existing values in the field that fall that outside the new range will remain in the table. If those values are no longer valid, you must manually edit them.
Considerations when setting or editing field lists or ranges
Keep the following in mind when working with lists of values or ranges:
- For numeric fields, you can define a list or a range but not both. Once you define one, you cannot configure the other.
- You cannot configure a list or set minimum and maximum values for system fields such as shape_area, shape_length, FID, and ObjectID.
- In ArcGIS Online, you can configure value lists and ranges for hosted feature layers only; you cannot configure value lists or ranges for hosted feature layer views or ArcGIS Server feature layers. If you create a hosted feature layer view from a hosted feature layer, the list and range values are applied to the view but cannot be altered from the view. To apply lists or ranges to ArcGIS Server feature layers, you must define domains on the data in the geodatabase before you publish the feature layer. See Create and manage domains in the ArcGIS Pro help for more information.
- When you publish a hosted feature layer from data in ArcGIS Pro or ArcMap that has coded value domains, those domains appear as a list in ArcGIS Online. However, lists in ArcGIS Online apply to and can be modified for individual fields only; altering the list on one field does not change the domain values on other fields.
- For ArcGIS Server feature layers, you can view coded value domains and range domains on fields as lists and minimum and maximum values, respectively, but you cannot edit them in ArcGIS Online.
- If you publish a hosted feature layer from ArcGIS Pro or ArcMap that contains subtypes with associated domains on other fields, you cannot view or edit the domains in ArcGIS Online.
- If you create a list for a field to which you have applied the Types (Unique Symbols) style, be sure the values in the list are the same as the unique values defined for your editing templates.