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 a hosted feature layer or delete a field from a hosted feature layer.

Add a field

When you open the details page for a hosted feature layer, you can use the Table or Fields view on the Data tab to add a field.

Add fields from the Table view

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

  1. On the layer's item page, click the Data tab to show the table.
    Note:

    You can also open the table in Map Viewer Classic to add fields to a table.

  2. If the hosted feature layer contains more than one sublayer, choose the sublayer to alter from the Layer drop-down menu.
  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 name. The alias can contain special characters 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.
      • 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.
      • 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.

Add fields from the Fields view

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

  1. From the layer's item page, click the Data tab to show the table.
  2. Click Fields.
  3. If the hosted feature layer contains more than one sublayer, choose the sublayer to alter from the Layer drop-down menu.
  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 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. Also, maps that use the field for filters or to apply styles will lose the filter or styling when you delete the field from the layer.

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.

When you open the details page for a hosted feature layer, you can delete a field from the Table or Fields view on the Data tab.

Delete a field from the Table view

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

  1. From the layer's item page, click the Data tab to show the table.
    Note:

    You can also open the table in Map Viewer Classic and delete fields from a table.

  2. If the hosted feature layer contains more than one sublayer, choose the sublayer to alter from the Layer drop-down menu.
  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 using the Fields view:

  1. From the layer's item page, click the Data tab to show the table.
  2. If the hosted feature layer contains more than one sublayer, choose the sublayer from the Layer drop-down menu.
  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 fields 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.