Editing capabilities

The composable FeatureForm in the ArcGIS Maps SDK for Kotlin Toolkit handles processing and display of a feature form. The toolkit component provides UI and logic for editing attributes built from FeatureForm and its related classes in the ArcGIS Maps SDK for Kotlin API. You will not need to access these classes directly in your code if you use the toolkit component as-is, though you will likely use them if you decide to extend the open-source toolkit.

Form elements

A feature form contains form elements that model the various fields in the feature being edited.

See the description in the toolkit for details and screenshots of the form elements as displayed by the toolkit component.

The four major types of form elements are:

  • Field form element - A form element representing a single field. There is one form element for each field defined in the feature form definition. If the layer has no form definition, there is one element for each field.
  • Attachments form element - An element containing attachments to the feature. The toolkit component displays a device-native UI for selecting new attachments and naming them. It also allows renaming or deleting existing attachments on the feature.
  • Group form element - A set of related form elements that the UI can operate on as a unit. In the toolkit component, a group element can be expanded, collapsed, or displayed/hidden together.
  • Text form element - Read-only text in the form.

Field form elements

A field form element exposes the value (number, text, date, barcode) from a feature attribute. To be visible in the form, the read-write visibilityExpression property of the element in the feature form definition must be set to true.

The allowed input for a form element is specified in the web map's feature form definition. In addition, the feature form takes into consideration the domain and length limit in the layer's data schema and any attributes rules (ArcGIS Server only).

Note the following interactions between the layer's schema in the feature service and the feature form definition:

  • To be edited, the form element must have the editableExpression property in the feature form definition and the editable property for the field in the layer's schema set to true.

  • If the feature form definition has a domain property, it takes precedence over domain definitions for the field, type, or subtype in the layer's schema.

  • If the requiredExpression property in the feature form definition is set to true, the field must have a value.

  • Text-based field elements can specify the maximum and minimum number of characters allowed for a text value. If the maxLength property is not specified in the feature form definition, the value is determined using the Field_Length property of the Field. If the minLength property is not specified, the value is 0, which means there is no minimum constraint.

List of field form elements

The following field form elements, defined in the ArcGIS Maps SDK for Kotlin API, are used internally by the toolkit component as needed, based on the feature form definition (or the layer's schema, when there is no form definition).

  • Switch - A binary switch (toggle) for the value of a form field element. It has two options, such as yes or no, true or false, and so on.

  • Radio buttons - A set of values for a form field element. Only one value can be selected at a time. Radio button input is best suited for values that don't have too many options.

  • Combo box - A list of values in a drop-down. Only one value can be selected at a time. In the toolkit component, the user can also enter text to filter the values displayed in the list and then select a value.

  • Text box - A single-line text input.

  • Text area - A multi-line text input for holding larger amounts of text.

  • DateTime picker - A calendar picker with an optional time picker. It applies only to Field objects of type esriFieldTypeDate.

  • Barcode - Input from a barcode or QR code scanner. A text value can be entered manually if the client doesn't support scanning or if the barcode or QR code cannot be scanned.

    A barcode scanner in a mobile device will look something like this during scanning:

    Example of scanning a QR code.

    And like this in the feature form:

    Example of barcode input for a field form element.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.