Benefits of feature forms
Attributes and attachments represent intelligent information about geographic features in a GIS. Although the information captured is important, collecting attribute values can be challenging. For example, attribute value errors can occur when an incorrect value is recorded within the attribute field or when a field is missing a value. Misspelled words and other typographical errors are common problems that can lead to inaccurate conclusions when performing a GIS analysis while solving a spatial problem. Attribute domains, subtypes, rules, and contingent values provide potential enhancements to reduce data entry error. Feature forms, also known as forms, further enhance the data collection process. A feature form can:
- Ease data entry for application end users.
- Limit the types of input by restricting and guiding data types (for example, character limits, list of allowed value options, numeric vs. string values, and so on).
- Perform easier calculations from attribute to attribute using Arcade Arcade script expressions evaluated upon data entry.
- Simplify adding, naming/renaming, and removing attachments.
Feature form definition in web map
Some layers can expose a feature form that models the fields and attachments in a feature for purposes of editing. Any layer that implement the IFeatureFormSource
interface supports feature forms. A FeatureLayer
that displays an ArcGISFeatureTable
and a SubtypeSublayer
that displays a SubtypeSubtable
have this capability. By default, the feature form will contain all fields and attachments, based on the layer's schema in the feature service.
Certain feature layers support a customized feature form. These feature layers include:
A customized feature form is defined for the layer by a web map author in the web map's JSON. The feature form definition can specify a variety of characteristics relevant to editing a feature, including:
- The set of included fields.
- Input type for a field (such as text box, radio buttons combo box, and so one).
- Constraints (max/min, coded value domains) on input values.
- Boolean values for whether a field is required, editable, visible.
- Arcade expressions that provide the same value to multiple fields or calculate a value based on functions and other attribute values.
A web map author creates a feature form definition using the Field Maps Designer or the map viewer in either ArcGIS Online or ArcGIS Enterprise. Each layer that requires a customized feature form should have its own feature form definition in the web map JSON. The layer will have a form
property, whose value consists of a form
array, an expression
array, and a title
string.
A feature form definition might look something like this:

Besides feature layers in web maps, a data author can create a feature form definition for an individual layer that implements IFeatureFormSource
and then publish the layer as a feature layer portal item. The feature form definition is saved to the layer's JSON.
Contact your web map author if you have questions about the feature form definition you are using.
When using feature form definitions configured in a web map, you will need to access the web map first. See Display a web map for documentation about how to programmatically access a web map from a portal.
Create a feature form instance
To create the feature form model, create an instance of the FeatureForm
class in the ArcGIS Maps SDK for .NET API, passing in the ArcGISFeature
to be edited. If your layer contains a feature form definition, the Feature
instance reflects the form elements and expressions designed by the web map author. If the layer has no feature form definition, the instance is the default feature form.
The feature to be edited can be an existing feature or a new one. There are many methods you can use to obtain the ArcGISFeature
, such as adding a new feature, querying for a feature, and identifying a feature.
var featureForm = new FeatureForm(feature, formDefinition);
Displaying a feature form
At this point, you could display the feature form by coding the form UI manually, using FeatureForm
and its related classes in the API to display the feature form elements, handle user input, validate input, and display error messages to the end-user.
However, we strongly encourage you to use the FeatureFormView in the toolkit, a robust component designed to display a polished, professional feature form with minimal coding required. For more information, see Edit using toolkit.