Display and edit feature attributes using feature forms.
Feature forms help enhance the accuracy, efficiency, and user experience of attribute editing in your application. Forms can be authored as part of the web map using Field Maps Designer or using Map Viewer. This allows a simplified user experience to edit feature attribute data on the web map.
Tap a feature on the map to open a sheet displaying the feature form. Select form elements in the list and perform edits to update the field values. Tap the submit icon to commit the changes on the web map.
- Add a
Map
to theMapView
usingPortal
URL and item ID. - When the map is tapped, perform an identify operation to check if the tapped location is an
ArcGISFeature
. - Create a
FeatureForm
object using the identifiedArcGISFeature
.
- Note: If the feature's
FeatureLayer
,ArcGISFeatureTable
, or theSubtypeSublayer
has an authoredFeatureFormDefinition
, then this definition will be used to create theFeatureForm
. If such a definition is not found, a default definition is generated.
- Use the
FeatureForm
toolkit component to display the feature form configuration by providing the createdfeatureForm
object. - Optionally, you can add a
ValidationErrorVisibility
option to theFeatureForm
toolkit component that determines the visibility of validation errors. - Once edits are added to the form fields, check if the validation errors list are empty using
featureForm.ValidationErrors
to verify that there are no errors. - To commit edits on the service geodatabase:
- Call
FinishEditingAsync()
to save edits to the database. - Retrieve the backing service feature table's geodatabase using
serviceFeatureTable?.ServiceGeodatabase
. - Verify the service geodatabase can commit changes back to the service using
serviceGeodatabase.ServiceInfo?.CanUseServiceGeodatabaseApplyEdits
- If apply edits are allowed, call
ApplyEditsAsync()
to apply local edits to the online service. - If edits are not allowed on the
ServiceGeodatabase
, then apply edits to theServiceFeatureTable
usingApplyEditsAsync()
- Call
- ArcGISFeature
- FeatureForm
- FeatureLayer
- FieldFormElement
- GroupFormElement
- ServiceFeatureTable
- ServiceGeodatabase
This sample uses a feature forms enabled Feature Form Places web map, which contains fictional places in San Diego of various hotels, restaurants, and shopping centers, with relevant reviews and ratings.
Follow the tutorial to create your own form using the Map Viewer. This sample uses the FeatureForm and GeoViewCompose Toolkit modules to be able to implement a Composable MapView which displays a Composable FeatureForm UI.
This sample uses the feature forms toolkit component. For information about setting up the toolkit, as well as code for the underlying component, visit the toolkit repository.
edits, feature, featureforms, form, toolkit