Add or delete a field

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 you discover that a set of attributes is no longer needed, you can delete the field that stores those attributes from the layer.

Only the layer owner or an administrator of the organization can add a field to or delete a field from a hosted feature layer.

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.

Note:

You can add fields to the table using the Fields pane in Map Viewer or when you open the table in Map Viewer Classic.

Add fields from the Table view

Follow these steps to add a field to an attribute table in the Table view:

  1. Open the item page of the hosted feature layer or table and click the Data tab to show the attribute table.
  2. If the hosted feature layer contains more than one layer, use the Layer drop-down menu to choose the correct layer.
  3. Click the Options button Options.
  4. Click Add Field and set the following:
    1. Field Name—Field names cannot contain special characters, such as spaces, hyphens, parentheses, brackets, or characters such as $, %, and #. 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.
    2. Display Name—An alternative name or alias for a field that is more descriptive and user-friendly than the field name. The alias can contain special characters, spaces, and database-reserved keywords.
    3. Type—Choose one of the following for the type of data you will store in the field:

      • 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.
      • 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.
        Note:

        When adding or editing Date Only values using the Table view, they must be specified in the YYYY-MM-DD format (for example, 2024-03-22).

      • Double—Numbers with decimal places.
      • Integer—Whole numbers from -2,147,483,648 to 2,147,483,647 (long integer).
      • String—Any sequence of characters.

        If you add a string field, use the Length property to define the field's maximum single-byte character length. Length is required for the String field type. The default is 256 characters.

      • 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.
        Note:

        When adding or editing Time Only values using the Table view, they must be specified in HH:mm:ss format (for example, 18:02:39).

      • 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.

    4. Optionally, define a default value that will be added to the field for all new features.

      The field will be populated with a default value when you add new rows (features) to the feature layer. Existing rows in the table will not be populated with this default value.

      To construct a default value for a timestamp offset field, you must define all three parts of the default value:

      • Day, month, and year
      • Local time
      • Offset from UTC

  5. If the hosted feature layer does not contain data, uncheck Allow Null Values if you want to ensure that editors always supply a value for the new field when adding features or updating attributes.

    This option is not available if the layer contains data, and the new field will allow null values.

  6. Click Add New Field.

Add fields from the Fields view

Follow these steps to add a field to an attribute table in the Fields view:

  1. Open the item page of the hosted feature layer or table and click the Data tab to show the attribute table.
  2. Click Fields.
  3. If the hosted feature layer contains more than one layer, use the Layer drop-down menu to choose the correct layer.
  4. Click Add and set the following:
    1. Field Name—Field names cannot contain special characters, such as spaces, hyphens, parentheses, brackets, or characters such as $, %, and #. 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.
    2. Display Name—An alternative name or alias for a field that is more descriptive and user-friendly than the name. The alias can contain special characters, spaces, and database-reserved keywords.
    3. Type—Choose one of the following for the type of data you will store in the field:

      • Big Integer—Whole numbers from -9,007,199,254,740,991 to 9,007,199,254,740,991. Use this type to store values that don't fit in the range of the integer data type.
      • Date—Date and time. See Date and time fields in ArcGIS Online..
        Note:

        While ArcGIS Online stores all date values in 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.
      • Double—Numbers with decimal places.
      • Integer—Whole numbers from -2,147,483,648 to 2,147,483,647 (long integer).
      • String—Any sequence of characters. When you create a string field, specify the maximum length, in single-byte characters, that a string field can store by providing a value in the Length field. The default is 256 characters.
      • 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.

    4. Optionally, define a default value that will be added to the field for all new features.

      Any existing rows in the table will not have this default value when the field is added.

      To construct a default value for a timestamp offset field, you must define all three parts of the default value:

      • Day, month, and year
      • Local time
      • Offset from UTC

  5. If the hosted feature layer does not contain data, uncheck Allow Null Values if you want to ensure that editors always supply a value for the new field when adding features or updating attributes.

    This option is not available if the layer contains data, and the new field will allow null values.

  6. Click Add New Field.

Delete a field

Use caution when deleting fields because, once you delete a field, the data in the field cannot be restored.

You cannot delete system fields such as the OBJECTID, CREATIONDATE, CREATOR, EDITDATE, and EDITOR fields or fields used to define styles stored in the layer, the time slider, filter, labels, search, or editor tracking. However, maps may be using fields for styling and filters that are different than the fields you configured on the layer, and 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.

Note:

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.

Delete a field from the Table view

Follow these steps to delete a field from an attribute table in the Table view:

  1. Open the item page of the hosted feature layer or table and click the Data tab to show the attribute table.
  2. If the hosted feature layer contains more than one layer, use the Layer drop-down menu to choose the correct layer.
  3. Click the column containing the field to delete.
  4. Click Delete.

    A message appears, prompting you to confirm the deletion.

  5. Confirm the delete operation.

Delete a field from the Fields view

Follow these steps to delete a field from an attribute table in the Fields view:

  1. Open the item page of the hosted feature layer or table and click the Data tab to show the attribute table.
  2. If the hosted feature layer contains more than one layer, use the Layer drop-down menu to choose the correct layer.
  3. Check the check box next to the field to delete.
  4. Click Delete, and confirm that you want the field deleted.

    If the Delete button is not present, one or more of the selected fields cannot be deleted.

    A message appears, prompting you to confirm the deletion.

  5. 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.