After you publish a hosted feature or table layer, you may need to store information about an additional attribute. If so, you can add a field to the layer. Similarly, if a set of attributes is no longer needed, you can delete the field that stores those attributes from the layer.
The layer owner or an administrator of the organization can add a field to or delete a field from a hosted feature layer. Members of a shared update group to which the layer is shared can also add and delete fields.
Add a field
You can add a field from the Table or Fields view on the Data tab of a hosted feature layer's or table's item page.
Tip:
You can also add fields to the table using the Fields pane in Map Viewer or when you open the table in Map Viewer Classic.
Complete the following steps to add a field to the attribute table of a hosted feature layer or to a hosted table from the item's page:
- Open the item page of the hosted feature layer or table, and click the Data tab.
By default, the Data tab opens in the Table view. You can add a field from this view or click the Fields button
to change to the Fields view.
- If the hosted feature layer contains more than one layer, use the Layer drop-down menu to choose the correct layer.
- Click Add field.
- In the Add field interface that appears, provide information to define the new field.
- Expand the relevant data type category and choose one of the following for the type of data you will store in the field:
Category Data type Description Text String Any sequence of characters.
Numbers Double Numbers with decimal places.
Integer Whole numbers from -2,147,483,648 to 2,147,483,647 (long integer).
Big Integer Whole numbers from -9,007,199,254,740,991 to 9,007,199,254,740,991. Use this type when you need to store numbers that don't fit in the range of the integer data type.
Dates Date Date and time. See Date and time fields in ArcGIS Online.
Note:
While ArcGIS Online stores all date values in coordinated universal time (UTC), you'll typically view and edit dates in your local time zone because most applications automatically convert to and from UTC. You will, however, need to specify the appropriate time zone when uploading the data—for example, as .csv files or shapefiles. Otherwise, the data is assumed to be in UTC.
Date Only Stores a date but no time values. This is useful when times aren't needed, such as when recording the day a permit expires or a customer's birth date.
Time Only Stores a time but no date values. Time is in 24-hour time, such as 16:30 for 4:30 p.m. This field data type is useful for recording such values as business hours and bus schedules.
Timestamp Offset Stores date and time with a value that indicates the time's offset from UTC. Including the value's offset from UTC with individual date and time values unambiguously identifies a single point in time. This makes a timestamp offset value more portable from one computer to another than a date value. For example, to store a value that indicates October 10, 2023 at 3:03 p.m. in the Newfoundland time zone (which is 3.5 hours behind UTC time), editors would provide the value 2023-10-10T15:03:00-03:30.
Global identifiers
GlobalID Stores a 36 alphanumeric string that acts as a unique identifier for a feature or table row.
This data type is considered a system field, is populated by ArcGIS Online, and is required for certain functionality such as adding attachments. This field type cannot be deleted or edited after you add it.
A hosted feature layer or table can contain only one globalID field.
GUID Stores a 36 alphanumeric string that acts as a unique identifier for a feature or table row.
This type of field is a user-defined identifier that editors populate.
- Click Next to proceed with defining properties for the field.
Properties vary depending on the data type.
- Provide a name for the field.
The field name is stored in the underlying database. Once defined, the field name does not change. Field names cannot contain special characters, such as spaces, hyphens, parentheses, brackets, or characters such as $, %, and #. Field names also cannot contain diacritic characters or characters that are not in the Latin alphabet. Avoid using field names that contain words that are typically considered database-reserved keywords, such as CHARACTER or DATE. If you attempt to add a field name with special characters or a database-reserved keyword, you'll receive an error message.
The field name is automatically assigned for globalID fields.
- In the Display name field, provide an alternative name or alias for the field that is more descriptive and user-friendly than the field name.
The display name can contain special characters, spaces, and database-reserved keywords. It can also contain diacritic characters and characters that are in non-Latin alphabets.
- If the layer does not contain data, disable the Allow null values toggle button if you want to ensure that editors always supply a value for the new field when adding features or updating attributes.
You cannot change this setting if the layer contains data because this field will be null for all existing features or rows.
This property cannot be altered for globalID fields; these cannot allow null values.
- If you are adding a string field, define the maximum length.
The Length property defines the field's maximum single-byte character length. The default is 256 characters.
- Optionally, set a default value for the field.
All new features or rows will populate the field with this value.
This setting is not supported for globalID or GUID fields.
- Optionally, provide a description of the field.
The field description helps communicate what a field contains without having to use long or complicated field names.
- Optionally, choose a field value type.
Field value types provide users and apps information about how values in the field should be formatted. For example, if you define a text field to be an email address, mobile app developers can design their app to include an @ sign or a pick list of domain types such as .com, .net, or .org to help editors populate the field correctly.
For GUID fields, the field value type defaults to Unique Identifier.
For a description of each value type, refer to the field values table in Describe attribute fields.
- Expand the relevant data type category and choose one of the following for the type of data you will store in the field:
- Click Add field.
Delete a field
Use caution when deleting fields from hosted feature layers because, once you delete a field, the data in the field cannot be restored.
You cannot delete system fields. These include the following:
- OBJECTID
- Fields used for editor tracking (CREATIONDATE, CREATOR, EDITDATE, and EDITOR)
- TYPEIDFIELD
- SUBTYPEFIELD
- KEYFIELD
- DISPLAYFIELD
Fields used to define styles stored in the layer, the time slider, filter, labels, or search also cannot be deleted. However, maps may be using fields for styling and filters that are different than the fields you configured on the hosted feature layer; the Delete option is available for these fields. Use caution when deleting fields that may be used for styling and filtering in maps.
You can delete a field from the Table or Fields view on the Data tab of a hosted feature layer's or table's item page.
Tip:
You can also delete fields from the table using the Fields pane in Map Viewer or when you open the table in Map Viewer Classic. You can also delete a field from its detailed view.
Delete a field from the Table view
To delete a field from an attribute table in the Table view, complete the following steps:
- Open the item page of the hosted feature layer or table, and click the Data tab to show the attribute table.
- If the hosted feature layer contains more than one layer, use the Layer drop-down menu to choose the correct layer.
- Click the Options button
in the column header.
- Click Delete.
A message appears, prompting you to confirm the deletion.
- Confirm the delete operation.
Delete a field from the Fields view
To delete a field from an attribute table in the Fields view, complete the following steps:
- Open the item page of the hosted feature layer or table, and click the Data tab to show the attribute table.
- Click the Fields button
to change to the Fields view.
- If the hosted feature layer contains more than one layer, use the Layer drop-down menu to choose the correct layer.
- To delete a single field, click the Options button
at the end of the field's row and click Delete field.
If the Delete field option is not present, the field cannot be deleted.
If it is present, clicking Delete field causes a message to appear, prompting you to confirm the deletion.
- To delete multiple fields, check the box next to each field and click Delete.
If the Delete button is not present, one or more of the selected fields cannot be deleted.
If it is present, clicking Delete causes a message to appear, prompting you to confirm the deletion.
- Confirm the delete operation.
Restrictions when adding or deleting fields
Consider the following when adding or deleting fields:
- You cannot add fields to or delete fields from copies of hosted feature layers, hosted feature layers that have related tile layers, or views created from hosted feature layers.
- You cannot add fields to or delete fields from hosted feature layers that have a dependent joined feature layer view.
- When you add a field to a hosted feature layer that has dependent hosted feature layer views, you must update the definition of each view in which you want the new field to appear. This is not possible if the view is a hosted joined feature layer view, as stated above.
- Added and deleted fields are not propagated from the hosted feature layer or view to dependent hosted scene layers.
- Some field types may not be fully supported in all ArcGIS clients.