Skip To Content

Prepare data to publish a feature service

The layers and tables you add to a map are included in the feature service when you publish. You need to configure the data to meet the requirements of a feature service.

Some data definition requirements are common whether your data source is a geodatabase or a database. Common requirements are described in the next section. In other cases, how you define the data depends on whether it's in a geodatabase or database. The Enterprise or workgroup geodatabase-specific requirements and Database-specific requirements sections below describe those differences.

If you plan to take the feature service offline, additional data preparation is needed. See Prepare data for use in offline feature services in the ArcGIS Pro help for more information on those requirements.

Note:

Virtual layers, such as route events and x,y events, are read-only through the feature service.

Requirements common to geodatabases and databases

The following requirements are true whether your source data is stored in a database, a workgroup geodatabase, or an enterprise geodatabase:

  • Data you publish to the feature service must come from a single source geodatabase or database. You cannot publish data from more than one database connection in a single map.
  • The data must have a valid spatial reference defined for it. If it does not, specify one in ArcGIS Pro before you publish. If no spatial reference is defined, you cannot publish the data.
  • You cannot edit views using ArcGIS clients; therefore, you cannot publish editable feature services that contain layers based on views.
  • The database account you stored with the database connection file you register with the GIS Server site must have the privileges necessary to access the data. If the feature service will remain read-only, the account only needs select access to the data. If you plan to use the feature service for editing, you must grant editing permissions on the data. If the database connection you register with the site uses operating system authentication, these permissions must be granted to the ArcGIS Server account.
  • Esri recommends that the map you publish as an editable feature service only contain data you want to edit. Publish data that you don't want to edit, such as basemap layers, in a different service. Another alternative is to use an ArcGIS Online basemap. For more information on designing a map to overlay online maps and services, see Designing a map to overlay ArcGIS Online, Google Maps, or Bing Maps.
  • Do not define multiple layers for the same feature class in the map you publish as a feature service if people will be adding the feature service to ArcGIS Pro and editing it. For example, if you want to serve the same feature class with different symbology or different definition queries applied, create separate feature services; do not include these differently configured representations of the same feature class in the same feature service.
  • If your data contains z-values and editors need to edit the feature service in clients that do not support adding z-values when editing feature geometry (such as Map Viewer in ArcGIS Online and ArcGIS Enterprise portals), configure the feature service to insert default z-values.
  • If your data contains m-values and editors need to edit the feature service in clients that do not support adding m-values when editing feature geometry (such as Map Viewer in ArcGIS Online and ArcGIS Enterprise portals), configure the feature service to insert NaNs for the m-values.

    Tip:

    ArcGIS Pro supports all editing operations (insert, delete, and update, including geometry updates) on features with m- and z-values. You do not need to configure default z- and NaN m-values if editors will only edit the feature service in these clients.

Enterprise or workgroup geodatabase-specific requirements

The feature service requirements listed here are specific to data stored in an enterprise or workgroup geodatabase. Your data must meet the requirements described in the previous section, as well as those described in this section.

  • You can publish tables or feature classes that are not registered with the geodatabase.
  • If you allow edits on the feature service and the feature service contains feature classes that participate in a geometric network, the feature class data must be in the same projection and coordinate reference system used by the editing client application. For example, if you plan to add the feature service to Map Viewer Classic to edit, the data must be stored in WGS 1984 Web Mercator (Auxiliary Sphere). Changing the projection in an ArcGIS Pro map before you publish is not sufficient; the data must use the same projection and coordinate reference system as the editing client.
  • Versioned (traditional and branch) and nonversioned geodatabase data is supported in feature services. Branch versioned data must be published to be edited.
  • To edit branch versioned data, you must publish a feature layer from ArcGIS Pro that references your registered data. See Share branch versioned data in the ArcGIS Pro help for more information.
  • It is not supported to publish a feature layer that references registered data from ArcGIS Pro if any of the following layers are present in your map:
    • Dimensions that have not been upgraded
    • Group layers
    • Query layers that contain virtual columns, where clauses, or joins
    • Rasters
    • Terrains
  • You can include annotation layers in your map when you publish a feature layer that references registered data from ArcGIS Pro.
  • Parcel fabrics created in ArcGIS Pro must be published as a feature service to edit it.
  • You can publish layers that are part of complex types, such as geometric networks and network datasets, but the types themselves are not returned by the feature service. For example, you can query the layers that are part of a network dataset, but you cannot query the network.
  • You can include topologies that contain branch versioned feature classes in feature services. Because you can only edit branch versioned data through a feature service, including the topology in the feature service allows you to validate the topology after editing and correct any topology errors that arise as a result of your edits. See Share a topology in the ArcGIS Pro help for more information.
  • Feature services allow queries on related data, but only if the relationship is defined through a geodatabase relationship class. If a published map document has a layer and table related through a geodatabase relationship class, the feature service allows queries on the layer to return objects from the related table. To support queries that return related objects, you must include the table and layer involved in the relationship class in the published map document. If either the origin or destination layer or table is not included in the map document, the feature service ignores the relationship.
    Note:

    For attributed relationship classes, include the relationship class table in the map document.

  • To maintain a utility network, you must publish it as a feature layer from ArcGIS Pro. See Publishing and consuming services with the utility network in the ArcGIS Pro help for more information.

When you use ArcGIS Survey123 with a feature service that references data in a registered enterprise geodatabase, run the Upgrade Attachments geoprocessing tool in ArcGIS Pro on the data. Upgrading attachments allows Survey123 to associate the images that people submit through the survey with specific survey questions. If you don't upgrade your existing attachments, images are still stored with the survey but will not be associated with a specific survey question.

Caution:

After you run the Upgrade Attachments tool, ArcGIS Desktop, ArcGIS Pro 2.6 and earlier, and ArcGIS Enterprise 10.8.1 and earlier can no longer access the attachment data. If you decide you need to remove the attachments to allow these clients to access the data, run the Downgrade Attachments geoprocessing tool.

Enable geodatabase functionality

If your data is stored in a geodatabase, you can take advantage of additional functionality. Configure this functionality before publishing a feature service.

Subtypes and attribute domains

If the data you publish is in a geodatabase, configure your datasets to use subtypes and attribute domains where appropriate to enhance the user experience of the feature service and prevent data entry errors. These provide ways of categorizing your data and ensuring that appropriate values are entered when the data is edited. Feature services can detect and use the subtypes and domains. For example, if you have a domain limiting the color of a fire hydrant to red, yellow, or blue, you see a drop-down list in the web application that allows you to only select one of those three colors.

Editor tracking

If you will enable editing on the feature service and will share it with others so they can edit, consider enabling editor tracking on the source feature classes to record who creates and alters features.

Attachments

An attachment is a media file associated with a feature or object in a geodatabase. For example, you can attach photographs and videos to a bird sighting layer. When a user clicks a feature in the bird sighting layer, they can view the attachment.

Feature services allow you to query and edit attachments but, to use this feature, you must configure the datasets in the geodatabase to support attachments. When these datasets are added to a map document and published, clients can query, insert, and delete the attachments through the feature service.

There are limits imposed on the size and file types you can attach to a feature service. To learn more about these limits and how to modify attachment settings, see Uploads in the ArcGIS REST API help.

For more information about how to configure a dataset to support attachments, see Add or remove file attachments.

Relationship classes

To include related data in a feature service or hosted feature layer, define a relationship class between the feature class and related table or feature class. The related data accessed through a relationship class will be included in the feature service you publish.

Branch versioned data

If you need other people to edit data that is registered for branch versioning, you must publish a feature service with version management enabled. Only the data owner can publish the branch versioned data. See Share branch versioned data in the ArcGIS Pro help for more information.

Topologies

Topologies check and enforce spatial rules to help you ensure geographic data integrity. If your data is registered for branch versioning, you can create topologies in the geodatabase before you publish them in a feature service.

Prepare geodatabase data for use while offline

To work with maps when you're offline (in other words, not connected to your organization's network), enable the sync capability on the feature services you use in your map. Before you publish a sync-enabled feature service that references data in a geodatabase, you must prepare the data. For more information, see Prepare data for use in offline feature services and Prepare feature services for offline use.

Database-specific requirements

The following describes feature service data requirements specific to data stored in a database. Your data must meet these requirements in addition to the requirements common to geodatabases and databases.

  • When you add database data to a map in ArcGIS Pro, a query layer is created. If you alter the query layer definition, ensure the query contains only one table, does not have duplicate columns, and does not include joins, where clauses, or virtual or merged columns.
  • The query layer that's defined for the table determines what data publishes. For example, tables containing data types that are not supported by ArcGIS can be published, but unsupported data types are not accessible through ArcGIS or the feature service. See View database data in ArcGIS for information on how the query layer is initially defined when you add a database table to the map.
  • The table must contain a unique integer column maintained by the database. If you create tables and load the data to the database using ArcGIS, a database-maintained unique integer object ID is added automatically. If you create data outside of ArcGIS, be sure to include a database-maintained, unique, not null integer column in the table. If such a column does not exist, you cannot publish a feature service. You can use the Add Incrementing ID Field geoprocessing tool to add a database-maintained integer column to your table in the databases listed in the tool's usage section. For all other databases, use database management system tools or SQL to create the ID column.
  • Supported database platforms from which you can publish feature services include Dameng, Db2 (on Linux, UNIX, or Windows), Oracle, PostgreSQL, SAP HANA, SQL Server, Teradata Vantage, supported cloud-based database services, and Google BigQuery (read-only).