Overview

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 FeatureFormSource 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 formInfo property, whose value consists of a formElements array, an expressionInfos array, and a title string.

A feature form definition might look something like this:

Example of a feature form definition.

Besides feature layers in web maps, a data author can create a feature form definition for an individual layer that implements FeatureFormSource 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 Kotlin API, passing in the ArcGISFeature to be edited. If your layer contains a feature form definition, the FeatureForm 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.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
                            val featureForm = FeatureForm(feature)

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 composable FeatureForm 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.

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