Mobile workers read, enter, and update forms to collect data and perform inspections. Ensure that mobile workers are successful in the field by configuring the form in the Field Maps web app. After you open the form builder, you can begin to configure the form in the following ways:
- Add basic form elements—Basic form elements allow mobile workers to provide information such as dates, numbers, text, and data scanned from barcodes.
- Add choice form elements—Choice form elements allow mobile workers to select from a list of values that you define.
- Use fields as form elements—Fields within the layer or table can be added to the form and configured as form elements.
Note:
You can configure forms in the ArcGIS Field Maps web app and the new Map Viewer in ArcGIS Online. To learn how to configure forms in Map Viewer, see Create forms for attribute editing.
You can view and edit forms in the ArcGIS Field Maps mobile app and the new Map Viewer in ArcGIS Online and ArcGIS Enterprise 10.9.1 and later.
Caution:
When you're editing the map, layers, and form in the Field Maps web app, do not simultaneously edit them in a separate browser tab. Editing the map, layers, and form across multiple tabs will result in the loss of your data.
Open the form builder
Use the form builder in the Field Maps web app to create the form mobile workers use in the field. Open the form builder by completing the following steps:
- In a browser, sign in to your organization and open the Field Maps
web app from the app launcher in ArcGIS Online or the app launcher in ArcGIS Enterprise.
The Maps page appears, displaying maps that you own and maps included in any shared update groups of which you're a member.
Note:
If you're an administrator using ArcGIS Online or ArcGIS Enterprise 10.9.1 or later, you have the option to view and configure any map in your organization. Click Filter and select All maps.
- Click the map to begin configuring it.
The Forms page appears, displaying the contents of your map.
Tip:
If you're using ArcGIS Online or ArcGIS Enterprise 10.9.1 or later, you can also open a map in Field Maps from the map's item page. Browse to the map's item page and click Open in Field Maps.
Note:
If your map contains nested group layers (group layers within group layers), they appear in the Field Maps web app on ArcGIS Online but are not currently supported in ArcGIS Enterprise. To learn how to create group layers, see Create and manage group layers in ArcGIS Online or Work with group layers in ArcGIS Pro.
- Click an editable layer or table.
The form builder appears with a blank form canvas.
Once you've opened the Form builder, you can begin configuring the form by dragging form elements onto the canvas. Form elements define the type of information mobile workers provide when filling out the form. You can add basic form elements or choice form elements, or you can use fields as form elements.
Tip:
You can copy a form between maps using ArcGIS API for Python and the copy_form_between_maps Python script or ArcGIS Online Assistant. For step-by-step instructions, see the Duplicate maps and forms for use in Field Maps blog post.
Add basic form elements
Basic form elements allow mobile workers to provide information such as dates, numbers, text, and data scanned from barcodes. Basic form elements are listed in the Form Elements list under Basic and include the following:
Form element | Field type | Description |
---|---|---|
Barcode | Double, Integer, or String | Scan a barcode or QR code to enter a value. |
Date/Time | Date | Enter a date or time. |
Number - Double | Double | Enter a decimal number value such as 1.2. |
Number - Integer | Integer | Enter a whole number value such as 2. |
Text - Multiline | String | Enter multiple lines of text. |
Text - Single line | String | Enter a single line of text. |
Double-click a form element or drag it to add it to the form canvas. Once you add a form element, define its display name and field information.
Note:
You cannot add form elements to a feature layer view.
Define display name and field information
When form elements are added to the form and saved, they become fields within the layer. These fields store information collected by mobile workers. For example, if you add a Text - Single line form element to the form, a string field is added to the layer.
When you add a form element to the form canvas, the Properties pane appears. Every form element requires a value for the Display name, Field name, and Field type properties. If the field is a string type, a Field length value is also required. Define the display name and field information by completing the following steps:
- Add a Display name value.
The display name is the name that appears on the form and is automatically used as the Field name value.
Note:
Any spaces in the Field name value are replaced with underscores and any invalid characters are removed.
- Optionally, change the Field name value.
You can change the field name if you want the name stored in the field to be different than the name displayed in the form. You may want a shorter field name if the display name is long, for example:
- Display name—Provide additional notes about the inspection
- Field name—additional_notes
- If you're configuring a Barcode element, select a value for Field type.
The field type you select depends on the type of information contained in the barcodes scanned by mobile workers.
- If you're configuring a form element with a String field type, set a value for Field length.
The field length indicates the maximum length of the field. The default value for the Text - Single line and Barcode form elements is 256 characters. The default value for the Text - Multiline form element is 1,000 characters.
- Optionally, provide a default value in the Default value text box.
Default values are applied to a field whenever a feature is created and are helpful if there are common values that mobile workers enter while collecting data.
- Click Save to save the form.
Once you save the form after adding a new form element, the Field name, Field type, Field length, and Default value properties cannot be changed.
Tip:
If you want to change these properties, you must delete the form element from the canvas and delete the field from the Fields list in the Form builder pane. You can then add a new form element and configure its properties.
Format basic elements
After entering the required display name and field information, you can configure additional properties for basic form elements to help streamline data collection in the field. For more information, see the following:
Add choice form elements
Choice form elements allow mobile workers to select from a list of values that you define. Choice form elements are listed in the Form Elements list under Choice and include the following:
Form element | Field type | Description |
---|---|---|
Combo box | Double, Integer, or String | Select from a list of values displayed in a drop-down menu. |
Radio buttons | Double, Integer, or String | Select from a list of values displayed as buttons. |
Switch | Double, Integer, or String | Select from one of two values displayed as a switch. |
Double-click a form element or drag it to add it to the form canvas. Once you add a choice form element, define its display name, field information, and list of values.
Note:
A radio button element is recommended for up to five values. Adding more than five values may require mobile workers to scroll through the form to find their selection. If you have more than five values, a combo box is recommended instead.
You cannot add form elements to a feature layer view.
Define display name and field information
When form elements are added to the form and saved, they become fields within the layer. These fields store information collected by mobile workers. For example, if you add a Combo box form element with a string type to the form, a string field is added to the layer.
When you add a form element to the form canvas, the Properties pane appears. Every form element requires a value for the Display name, Field name, and Field type properties. If the field is a string, a Field length value is also required. Define this information by completing the following steps:
- Add a Display name value.
The display name is the name that appears on the form and is automatically used as the Field name value.
Note:
Any spaces in the Field name value are replaced with underscores and any invalid characters are removed.
- Optionally, change the Field name value.
You can change the field name if you want the name stored in the field to be different than the name displayed in the form. You may want a shorter field name if the display name is long, for example:
- Display name—Select the tree type
- Field name—tree_type
- Select a value for Field type.
The field type is applied to the list of values. Once you create a list of values, you cannot change the field type.
- If you're configuring a form element with a String field type, set a value for Field length.
The field length indicates the maximum length of the field and is applied to the list of values. The default field length is 256 characters.
After you define the display name and field information, create a list of values.
Note:
You cannot save a new choice form element until you create the list of values.
Create a list of values
A list of values (also known as a coded value domain) defines the options mobile workers can choose from when filling out the form. Providing a list of values streamlines data collection in the field and ensures consistency in the data being entered. Each value in a list includes a label and a code:
- Label—The label is the value displayed when filling out the form in Field Maps and how you want the value to appear to mobile workers. It's also displayed when viewing the attribute table in Map Viewer and other apps.
- Code—The code is the value stored in the feature layer.
You can add values one-by-one or by uploading a .csv file. How you create a list depends on the type of choice element you're configuring.
Note:
You cannot create a list of values in a feature layer view.
Create a list for a combo box or radio buttons
To create a list of values for a combo box or radio buttons element, complete the following steps:
- In the Properties pane, click Create list.
The List of values window appears.
- Optionally, populate the list of values by uploading a .csv file.
- Ensure your .csv file matches the required formatting shown below.
The .csv file must contain two columns: one for labels and one for codes. The table below shows the required format for a .csv file that contains three values:
For best results, encode the .csv file using UTF-8 character encoding. If you're using Microsoft Excel to create your .csv file, save it as CSV UTF-8.Label 1
Code 1
Label 2
Code 2
Label 3
Code 3
Caution:
The codes must use the field type defined for the form element. If the field type is string, the codes must also be less than or equal to the maximum field length defined for the form element.
Commas are not supported when adding codes in Field Maps and cannot be used as thousands or decimal separators. To add decimal separators in codes, you must use periods.
If you're editing the raw .csv file outside of Microsoft Excel or similar programs, you must use escaping for values that contain double quotes. For example, if you have a label or code of 24", it must be written as "24""" in the .csv file.
The .csv file will fail to upload if the codes do not meet these requirements.
- Drag the .csv file onto the List of values window or click select from your device to select it from your file explorer.
The list is populated with the values from your .csv file.
- Ensure your .csv file matches the required formatting shown below.
- Optionally, add values one-by-one.
Add values by clicking the Add button. Provide a label and code for each value.
Caution:
The codes must use the field type defined for the form element. If the field type is string, the codes must also be less than or equal to the maximum field length defined for the form element.
Commas are not supported when adding codes in Field Maps and cannot be used as thousands or decimal separators. To add decimal separators in codes, you must use periods.
- Click Done to create the list.
After you click Done, you cannot change the field type, or length of the form element.
The Create list button changes to Manage list with a number in parentheses that represents the number of values in the list.
- Optionally, select a default value from the Default value drop-down menu.
Default values are applied to a field whenever a feature is created and are helpful if there are common values that mobile workers enter while collecting data.
Note:
Once you save the form, you cannot change the Default value property.
- Once you've defined the display name, field information, and list of values, click Save to save the form.
Once you save the form after adding a new form element, the Field name, Field type, and Field length properties cannot be changed.
Tip:
If you want to change these properties, you must delete the form element from the canvas and delete the field from the Fields list in the Form builder pane. You can then add a new form element and configure its properties.
To learn how to manage the list after its created, see Manage the list of values.
Create a list for a switch
A switch element includes two values. To create a list of values for a switch element, complete the following steps:
- Under Switch values, provide two values for mobile workers to choose from.
These are the labels for each value. Codes for each value are automatically generated.
- Optionally, change the codes for each value by clicking Manage codes.
The List of values window appears and you can edit the label and code for each value. When you're finished, click Done to close the window.
After you click Done, you cannot change the field type or length of the form element.
Caution:
The codes must use the field type defined for the form element. If the field type is string, the codes must also be less than or equal to the maximum field length defined for the form element.
Commas are not supported when adding codes in Field Maps and cannot be used as thousands or decimal separators. To add decimal separators in codes, you must use periods.
- Under Default value, choose the value you want selected by default in the form. If the switch element does not contain a default value, it displays as a combo box in the form.
Note:
Once you save the form, you cannot change the Default value property.
- Once you've defined the display name, field information, list of values, and default value, click Save to save the form.
Once you save the form after adding a new form element, the Field name, Field type, and Field length properties cannot be changed.
Tip:
If you want to change these properties, you must delete the form element from the canvas and delete the field from the Fields list in the Form builder pane. You can then add a new form element and configure its properties.
To learn how to manage the list after its created, see Manage the list of values.
Format choice elements
After you've defined the display name, field information, list of values, and default value, you can configure additional properties for choice form elements to help streamline data collection in the field. For more information, see the following:
Use fields as form elements
Fields and contingent field groups within the layer or table can be added to the form and configured as form elements. Once fields are added, you can configure how they appear on the form. If a field includes a list of values, you can manage those as well.
Add fields to the form
Fields within the layer appear in the Fields list next to the form canvas. You can add fields to the form in one or more of the following ways:
- Add fields one by one—To add a single field to the form, double-click it or drag it onto the form canvas.
- Add a selection of fields to the form—To add multiple fields to the form, press the Ctrl key and click the fields you want to include, and then drag them to the form canvas.
- Add all fields to the form—To include all fields in the form, click Add all in the Fields list.
- Convert the pop-up—If you configured the form as a pop-up in Map Viewer Classic, you can configure the form using the existing pop-up configuration. On the blank form canvas, click Convert pop-up. Editable fields from the pop-up are added to the canvas and placed in their original order. Fields that are not part of the pop-up configuration appear in the Fields list.
Tip:
If the layer or table contains a large number of fields, you can use the Find fields search bar in the Fields list to locate a specific field.
If fields are required, they appear in the Required section of the Fields list and must be added to the form. Fields appear in the Required section if they were configured to not allow null values when created in ArcGIS Online.
Add contingent field groups to the form
If contingent field groups were configured in ArcGIS Pro, they appear in the Field groups list next to the form canvas. If field groups share common fields, they are listed together. You can add field groups to the form in one or more of the following ways:
- Add field groups one by one—To add a single field group to the form, double-click it or drag it onto the form canvas.
- Add a selection of field groups to the form—To add multiple field groups to the form, press the Ctrl key and click the field groups you want to include, and then drag them to the form canvas.
- Add all field groups to the form—To include all field groups in the form, click Add all in the Field groups list.
Tip:
If the layer or table contains a large number of field groups, you can use the Find field groups search bar in the Field groups list to locate a specific group.
When a field group is added to the form, its contingent fields are contained in a group element. Contingent fields should stay grouped together so mobile workers can fill them out sequentially in the Field Maps mobile app. If a field is removed from its field group, a warning appears.
If field groups are required, they appear in the Required section of the list and must be added to the form. Field groups are required if they were configured as restrictive in ArcGIS Pro.
Caution:
If contingent field groups are not added to the form canvas, mobile workers may not be able to submit the form in the Field Maps mobile app.
To learn how contingent values work in the Field Maps mobile app, see Select contingent values. To learn how to create contingent field groups in ArcGIS Pro, see Create and manage contingent values.
Configure fields as form elements
Once fields have been added to the form canvas, they can be configured as form elements. Configure how fields appear in the form by completing the following steps:
- Select the field you want to configure.
The Properties pane appears.
- Select the input type.
The input type defines how the form element appears in Field Maps. The input type you select depends on the field type and whether the field contains a list of values.
If the field does not contain a list of values, and you don't want to create a list of values, select one of the following options from the Input type drop-down menu:
Input type Field type Description Barcode
Double, Integer, or String
Scan a barcode or QR code to enter a value.
Date
Date
Enter a date.
Date and time
Date
Enter a date and time.
Number - Double
Double
Enter a decimal number value such as 1.2.
Number - Integer
Integer
Enter a whole number value such as 2.
Text - Multiline
String
Enter multiple lines of text.
Text - Single line
String
Enter a single line of text.
Tip:
If the field is part of a contingent field group and contains a range domain, the Number - Integer input type is recommended.
If the field does contain a list of values, or if you want to create a list of values, select one of the following options from the Input type drop-down menu:
Input type Field type Description Combo box
Double, Integer, or String
Select from a list of values displayed in a drop-down menu.
Radio buttons
Double, Integer, or String
Select from a list of values displayed as buttons.
Switch
Double, Integer, or String
Select one of two options displayed as a switch.
Note:
The Radio buttons input type is recommended for up to five values. Adding more than five values may require mobile workers to scroll through the form to find their selection. If you have more than five values, a combo box is recommended instead.
To learn how to create a list of values for a field, see Create a list of values.
If a Switch element does not contain a default value, it displays as a combo box in the form. You can set a default value for an existing field by managing feature templates.
Caution:
If the field is part of a contingent field group and contains a list of values, the Combo box input type must be selected or the form will fail to load in the Field Maps mobile app.
If the field includes <null> as a contingent value, the Include "No value" option must be enabled or the form will fail to load in the Field Maps mobile app.
- Configure additional properties.
Once you've selected the input type, there are additional form element properties you can configure to streamline data entry in the field. You can also manage the list of values for combo box, radio buttons, and switch elements. To learn about the different ways you can configure form elements, see the following:
Provide a title
Include identifying information in the title so mobile workers choose the correct form. By default, the title of the form is the name of the layer or table.
- While configuring the form, click the current title.
- Provide a title that mobile workers can easily identify.
- Click Save.
Tip:
If you're using ArcGIS Online or ArcGIS Enterprise 10.9.1 or later, click Add field in the Formatting pane to include a field value in the title.
Order the elements on the form
Order the form elements in a way that makes it easier for mobile workers to provide information in the field. If you have a long form, list the required elements first so mobile workers don't have to search for the key items.
- While configuring the form, drag form elements to order them on the form canvas or select a form element and use the arrow keys to move it up or down.
- Click Save.
Tip:
If you're using ArcGIS Online or ArcGIS Enterprise 10.9.1 or later, you can select multiple form elements by pressing the Ctrl key and clicking each element.
Group elements together
If you have related information in the form, you can group it together, similar to sections of a paper form. Group form elements using the Group element in the Form Elements list.
- While configuring the form, click a Group element from the Form Elements list.
A form element is added to the form canvas.
- Drag form elements into the group.
- Select the group element to edit its properties.
The Properties pane appears, allowing you to edit the following information:
- Display name—Provide a name for the group that describes its fields.
- Description—Provide a description for the group.
- Initial state—Check this check box if you want the initial state of the group to be expanded in the mobile app.
- Conditional visibility—Add an Arcade attribute expression to apply rules for when the group should appear in the form. See Conditional visibility for details.
- Click Save.
Tip:
If you're using ArcGIS Online or ArcGIS Enterprise 10.9.1 or later, you can remove all form elements from a group by selecting Ungroup from the group toolbar. You can remove multiple elements from the group by pressing Ctrl, selecting each element you want to remove, and dragging them out of the group.
Update labels (display names)
In Field Maps, the Display name text is used as the label of the form element. Provide a name or short question familiar to your mobile workers.
Tip:
Keep labels short and concise. While you can use a question, Field Maps scales the text to fit on a single line in the form.
- While configuring the form, click a form element to open the Properties pane.
- In the Formatting section, edit the Display name text to change the element's label on the form.
- Click Save.
Format text elements
Text elements can be configured to use a text box or text area. A minimum and maximum character count can also be configured for each text element.
- While configuring the form, click a form element that requires text to open the Properties pane.
- In the Formatting section, click the Input type drop-down menu and select one of the options.
- Text - Single line—Allow the mobile worker to provide one line of text.
- Text - Multiline —Allow the mobile worker to provide multiple lines of text.
- In the Formatting section, set values for Min. length and Max. length for the element.
- Click Save.
Format date elements
Date elements can be configured to use a date picker or a date and time picker. A range can also be set for each date element.
- While configuring the form, click a form element that requires a date to open the Properties pane.
- In the Formatting section, click the Input type drop-down menu and select one of the options.
- Date—Allow the mobile worker to provide a date.
- Date and time—Allow the mobile worker to provide a date and time.
- In the Formatting section, set values for the Start date, Start time, End date, and End time properties that mobile workers can choose from.
- Click Save.
Format barcode and QR code elements
If your assets include barcodes or QR codes, you can scan the barcode or QR code with the Field Maps mobile app and populate one or more entries based on the scan. In Field Maps, text and numeric entries with the Barcode scanner input type contain an option for scanning a barcode or QR code. When a mobile worker chooses Scan barcode or QR code , the device's camera app opens and reads the barcode or QR code. The information it contains populates the selected entry when the scan is complete.
- While configuring the form, click a field that requires a barcode or QR code element to open the Properties pane.
- In the Formatting section, click the Input type drop-down menu and select Barcode scanner.
- Click Save.
Note:
Field Maps supports the barcode and QR code formats supported by the operating system. For Android support, see Scan Barcodes with ML Kit on Android. For iOS support, see Machine-Readable Object Types.
Provide hints
In Field Maps, the Placeholder text is used to display informative hint text for an entry without a value. For example, you can provide information about where the mobile worker obtains the information or details about how to format the information when entered.
Note:
Placeholder text for date fields or fields with coded value domains does not display in the Field Maps mobile app.
- While configuring the form, click a form element to open the Properties pane.
- In the Formatting section, edit the Placeholder text to change the hint text for the element.
- Click Save.
Provide descriptions
The Description text is used to provide contextual information that describes the purpose of a form element.
- While configuring the form, click a form element to open the Properties pane.
- In the Formatting section, edit the Description text to change the description for the element.
- Click Save.
Manage a list of values
If your form element contains a list of values (also known as a coded value domain), you can edit those values in the form builder. How you manage a list depends on the type of choice element you're configuring.
Note:
To create a list of values for a field or form element, see one of the following:
- Create a list of values in the Field Maps web app
- Define attribute lists and ranges in ArcGIS Online
- Define attribute lists and ranges in ArcGIS Enterprise
- Create and manage domains in ArcGIS Pro
If you created a coded value domain for a date field in ArcGIS Pro, you cannot edit its list of values in the Field Maps web app.
You cannot edit a list of values in a feature layer view.
Manage the list for a combo box or radio buttons
Manage the list of values for a combo box or radio buttons element by completing the following steps:
- Select the form element.
The Properties pane appears.
Note:
You can change the input type for the list of values by selecting an option from the Input type drop-down menu.
- Click Manage list.
Note:
The number in parentheses in the Manage list button represents the number of values in the list.
The List of values window appears.
- Manage the list of values in one or more of the following ways:
- Add values by clicking the Add button .
- Edit the labels and codes.
- Reorder the values by dragging them or selecting them and using the arrow keys.
- Replace the list of values by dragging a .csv file containing label and code values onto the window. The .csv file must match the required formatting. For best results, encode the .csv file using UTF-8 character encoding. If you're using Microsoft Excel to create your .csv file, save it as CSV UTF-8.
Caution:
The codes must use the field type defined for the form element. If the field type is string, the codes must also be less than or equal to the maximum field length defined for the form element.
Commas are not supported when adding codes in Field Maps and cannot be used as thousands or decimal separators. To add decimal separators in codes, you must use periods.
If you're editing the raw .csv file outside of Excel or similar programs, you must use escaping for values that contain double quotes. For example, if you have a label or code of 24", it must be written as "24""" in the .csv file.
If a value is used in an expression, editing its code may cause an error in the form.
- When you're finished managing the list of values, click Done to close the window.
- Click Save to save the form.
Manage the list for a switch
Manage a list of values for a switch element by completing the following steps:
- Select the form element.
The Properties pane appears.
Note:
You can change the input type for the list of values by selecting an option from the Input type drop-down menu.
- Manage the list of values in one or more of the following ways:
- Edit the labels under Switch values.
- Reorder the values by clicking the Switch order of values button .
- Edit the codes in the List of values window by clicking Manage codes. When you're finished editing the codes, click Done to close the window.
Note:
The codes must use the field type defined for the form element. If the field type is string, the codes must also be less than or equal to the maximum field length defined for the form element.
If a value is used in an expression, editing its code may cause an error in the form.
- Click Save to save the form.
Require form elements
You can configure form elements so mobile workers are required to provide a value before submitting the form. For example, if all inspections require an inspection ID, you can require that value in the form. If you require a form element, you must also decide whether null values are allowed in the feature layer for that field. Require form elements by completing the following steps:
- While configuring the form, click a form element to open the Properties pane.
- In the Formatting section, enable the Required check box to require a value in Field Maps.
- Decide if null values are allowed in the feature layer by selecting Yes or No.
If null values are allowed, the field is not required when editing the feature layer outside of the form. If the layer has one or more records, you must allow null values.
- Click Save.
Required elements are indicated in the form by an asterisk next to the display name and prevent submission until a value is provided.
Set default values
Default values are applied to a field whenever a feature is created and are helpful if there are common values that mobile workers enter while collecting data. You can set default values while creating new form elements in ArcGIS Field Maps or while creating new fields in ArcGIS Online, ArcGIS Enterprise, or ArcGIS Pro. To learn how to set default values while creating form elements or fields, see one of the following:
- Add basic form elements in ArcGIS Field Maps
- Add choice form elements in ArcGIS Field Maps
- Add or delete a field in ArcGIS Online
- Add or delete a field in ArcGIS Enterprise
- Create and manage fields in ArcGIS Pro
Default values that are specified as part of a feature template are applied to the field when the feature template is used to create a feature. This allows you to have different default values for a single field depending on the type of feature that is being created. If a field has an existing default value, the default for a feature template overrides it and is used. To provide default values for a feature template, see Manage feature templates.
Disable editing
By default, fields in the form are enabled for editing; however, you can change the setting so mobile workers cannot edit the fields. Read-only elements allow mobile workers access to information but prevent them from editing it.
- While configuring the form, click a form element to open the Properties pane.
- In the Formatting section, uncheck the Allow mobile users to edit check box to prevent mobile workers from editing the field.
- Click Save.
Add Arcade expressions
You can create expressions using ArcGIS Arcade to streamline and automate data entry in the form. You can create the following expressions in Field Maps:
- Calculated expressions—Automatically calculate data in the form based on attribute, geometry, and account information.
- Conditional visibility expressions—Conditionally show or hide form elements based on values added to existing fields.
Add calculated expressions
Calculated expressions automatically calculate and populate data in the form, saving time for mobile workers in the field. You can build calculated expressions in a variety of ways with Arcade, including using feature attributes, geometry, and account information for the signed-in user.
Calculated expressions are dynamic, meaning they automatically update the form as information changes. As a result, mobile workers can see the updated calculation before submitting the form. To create a calculated expression, complete the following steps:
- While configuring the form, click a form element to open the Properties pane.
Caution:
If the Allow editing check box is checked, the expression will not run.
- In the Calculated expressions section, click Add expression.
The Arcade editor appears. The editor allows you to write and test your expression before saving it to the selected form element.
- Click Edit next to the title and provide a title for the expression.
- Write the calculated expression.
For example, the following expression checks whether polygon feature geometry is null before calculating the area in square meters. Additional examples are provided below.
To learn more about calculating area with Arcade, see Area (Geometry Functions).if (IsEmpty(Geometry($feature))){ return; } else{ Area($feature, 'square-meters') }
- Click Test to make sure the expression doesn't result in an error.
- Click OK to close the Arcade editor.
The calculated expression is applied to the form element.
- Click Save to save the expression and the form.
Now that you've saved your expression, you can apply it to any form element by selecting the form element and clicking the expression you created. You can see which elements are using the Arcade expression by clicking the number next to the expression in the Properties pane under Calculated expressions.
Note:
You can duplicate, edit, or delete the expression at any time from the Calculated expressions menu.
The following are examples of calculated expressions:
- Provide date information—The following expression provides the current date for a date field:
To learn more about date information you can access with Arcade, see Date Functions.return Today();
- Include account information for the signed-in user—The following expression returns the full name of the user signed in to Field Maps:
To learn more about account information you can access with Arcade, see GetUser (Data Functions).var userInfo = GetUser(portal("https://<org>.maps.arcgis.com"),"")return (userinfo["fullName"])
- Extract information from intersecting layers—The following expression is applied to a ZIP Code field in the form. It checks whether the feature geometry is null and then extracts a ZIP Code value from an intersecting parcel layer:
To learn more about extracting information from intersecting layers with Arcade, see Intersects (Geometry Functions).if (IsEmpty(Geometry($feature))){ return; } else{ var parcels_FS = Intersects($feature, FeatureSetByName($map,"Redlands parcels")); if (Count(parcels_FS) == 1){ return Text(First(parcels_FS).ZIP_CODE); } }
For a list of all the functions offered in Arcade, see the Arcade Function Index.
Add conditional visibility expressions
You can conditionally show or hide elements in the form based on values added to previous fields. For example, a building assessment form includes a field to indicate whether there is water damage. It also includes a group form element containing fields related to water damage. A conditional visibility expression can be applied to the water damage group so it only appears if water damage is indicated in the earlier field. To create a conditional visibility expression, complete the following steps:
- While configuring the form, click a field or group to open the Properties pane.
- In the Conditional Visibility section, click Add expression.
The Edit expression window appears. The editor allows you to write an expression and preview it in Arcade before saving it to the selected field or group.
- Click Edit next to the title and provide a title for the expression.
- Build the expression.
Each expression is defined by one or more conditions. A condition includes a field name, an operator, and potentially, a value. The list of available operators is determined by the type of field (string, number, or date).
For example, if a water damage group element only needs to appear if water damage was indicated in an earlier field, the following condition can be used to build the expression:
- Field name—Water damage
- Operator—is
- Value—Yes
Here is what the same expression looks like in Arcade syntax:
DomainName($feature, "water_damage") == "Yes"
The Field Maps web app applies the Arcade Constraint profile to evaluate whether a feature meets the criteria defined in the expression. If a value other than Yes is indicated in the water_damage field, the water damage group will not appear in the form.Note:
To create more complex expressions, click Launch Arcade editor.
If you use multiple conditions, you can choose whether all conditions must be true or only one condition must be true for the form element to be displayed.
- Click Save.
The conditional visibility expression is applied to the group or field.
Now that you've saved your expression, you can apply it to any form element by selecting the form element and clicking the expression you created. You can see which elements are using the Arcade expression by clicking the number next to the expression in the Properties pane under Conditional Visibility.
Note:
You can duplicate, edit, or delete the expression at any time from the Conditional Visibility menu. To edit the expression using Arcade, click Edit (advanced) from this menu.
Preserve values when fields are conditionally hidden
When mobile workers are filling out the form, they may enter values for fields that become hidden due to conditional visibility rules. You can decide whether values that become hidden are preserved in the layer by completing the following steps:
- While configuring the form, expand the Form settings panel in the Form builder pane.
- To preserve values when fields are conditionally hidden, check the check box under Field values.
Values are preserved in the layer even if the corresponding fields become hidden on the form.
Note:
The Field values setting is not currently supported on ArcGIS Enterprise. If fields become hidden, the values for the fields are cleared. If a group form element becomes hidden, all values it contains are cleared.
Format high-accuracy metadata display
Fields that contain high-accuracy metadata don't appear in the form or in the Fields list. If you are displaying high-accuracy metadata in the pop-up, format the numbers to use an appropriate number of decimal places. If you're displaying the fix time, format the date.
Known issues
Known issues for building a form in the Field Maps web app and instructions for how to resolve them are provided below.
Unable to configure the form for a table
If a table is related to a layer with GNSS fields, you cannot configure its form; however, you can configure the form for a copy of the table. To create a copy of a related table, complete the following steps:
- Browse to the item page for the layer that contains the GNSS fields and click the Visualization tab.
- Click Save as new layer and provide a title.
- Click Save.
A copy of the layer and the related table are created and added to My content.
- Return to the Field Maps web app.
You can now configure the form for the copy of the table.