Configure forms for attribute editing

If your map contains feature layers (hosted feature layers, hosted feature layer views, hosted table layers, subtype group layers, or ArcGIS Server feature layers), you can define forms that editors can use when they update field values for the feature layers in the web map. You can define a form for every feature layer in the map or only those layers that you know the users of the map will need to edit.

Tip:

If you own the feature layer that is in the map or you are an organization administrator, you can configure forms for the feature layer item before you enable editing on it.

When you configure a form, you specify what form elements the form contains and how the elements appear. Having a form helps guide editors to the correct fields and allowable attribute values for each editable field.

The form can be saved as part of the map or the layer. When you share the map or layer, others can use the forms you define to edit the feature layers or related records in the map. To learn more, see the Save the form section below.

Note:

Currently, you can configure forms in Map Viewer in ArcGIS Online and ArcGIS Enterprise and in Field Maps Designer.

Before configuring a form

Before you configure a form for a feature layer in a map, familiarize yourself with the layer's contents and field settings. What a field contains affects whether you create element groups for fields. The settings that are applied to a field—such as whether null values are allowed, whether a default value is defined, and whether the layer owner defined lists for the field—affect how you format the field elements on the form.

Configure a form

You can configure an input form for each feature layer in the map. You define the fields (elements) that appear on the form and where they are placed.

When an editor selects a feature in an editable feature layer, the form appears so the editor can input attribute values for that layer.

To configure a form for a feature layer in a map, complete the following steps:

  1. Confirm that you are signed in to the organization and that you have the privilege to create, update, and delete content.
  2. On the Contents (dark) toolbar, click Layers to open the Layers pane.
  3. Add a feature layer to the map.
  4. With the feature layer selected, click Configure editing Configure editing on the Settings (light) toolbar, and click Forms Forms.

    The Configure form window appears.

  5. Use the following options alone or in combination to add elements to the form:

    Form elements are field groupings and the input fields that appear on the form. Field elements are based on existing fields in the feature layer.

    • Convert the existing pop-up—If you configured pop-ups for the feature layer, you can use the existing pop-up configuration as a starting point to configure the form.
    • Add basic form elements—Basic form elements allow editors to provide information such as dates, numbers, text, and data scanned from bar codes.
    • Add choice form elements—Choice form elements allow editors to select from a list of values that you define.
    • Add attachments—Attachment elements allow editors to upload documents, media, and other files.
    • Create groups of elements—You can create expandable and collapsible group elements to keep logically related information together on the form.
    • Add descriptive text—You can add descriptive text to the form to provide contextual information that describes the purpose of a form element.
    • Add fields—Choose which fields in the layer to add to the form. When a field is added to the form canvas, it becomes a form element.
    • Add related record elements—You can add related record elements to the form when the feature layer has a related table or feature layer.
    • Add field groups—If the data in the feature layer has contingent values defined, the Field groups list is present in Form builder. This allows you to add logically related groups of fields to the form canvas in a single step.
  6. After you add elements to the form canvas, format each element.
  7. Optionally, write ArcGIS Arcade expressions that define conditions that affect an element.
  8. When you finish adding, formatting, and configuring conditional expressions for the elements on the form, click OK.
  9. Save the form.

    Note:

    If you close the map without saving, you lose the form.

If you need to change the form, repeat the steps above. Be sure to save the form after you edit it.

Convert the existing pop-up

If the feature layer has pop-ups configured, click Convert pop-up to add fields from the pop-up to the form canvas.

Fields that are not part of the pop-up configuration appear in the Fields list in Form builder. You can drag them onto the form canvas to add them as elements to the form as described in the next section.

After you add fields as elements to the form, you can create groups to aggregate related fields or proceed with formatting field elements.

Note:

Fields that contain high-accuracy GPS metadata cannot be added to the form.

Add basic form elements

Basic form elements allow editors to provide information such as dates, numbers, text, and data scanned from bar codes. Basic form elements are listed in the Form elements list under Basic and include the following:

Form elementField typeDescription

Barcode

Double, Integer, Big Integer, or String

Scan a barcode or QR code to enter a value.

Date

Date only

Enter a date in YYYY-MM-DD format.

Date and time

Date or Timestamp offset

Enter a date and time.

Time

Time only

Enter a time in hh:mm or hh:mm:ss format

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.

To add a basic element to the form, complete the following steps:

Note:

You cannot add form elements to a feature layer view or subtype group layer.

  1. In the Basic list, drag an element to the form canvas.

    The basic element is added to the form canvas.

  2. Format the properties of the basic form element.

Add choice form elements

Choice form elements allow editors 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 elementField typeDescription

Combo box

Double, Integer, or String

Select an option from a list of values displayed in a drop-down menu.

Multiple choice

String

Select one or more options from a list of values displayed as buttons.

Radio buttons

Double, Integer, or String

Select an option from a list of values displayed as buttons.

Switch

Double, Integer, or String

Select from one of two values displayed as a switch.

Note:

The Radio buttons input type is recommended for up to five values. Adding more than five values may require editors to scroll through the form to find their selection. If you have more than five values, a combo box is recommended instead.

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 editing templates.

To add a choice element to the form, complete the following steps:

  1. In the Choice list, click Reposition Reposition, and drag an element to the form canvas.

    The choice element is added to the form canvas.

  2. Click the element on the form canvas to select it.
  3. In the Formatting section of the Properties pane, create a list of values by doing one of the following:
    • For a combo box or radio buttons, click Create list, and enter or import values. Click Done to add the values to the list and return to the Properties pane. Optionally, do any of the following:
      • Choose a default value from the Default value drop-down menu.
      • Check the Include "no value" option check box to include a null value option.
    • For multiple choice values, click Create choices, and enter or import choices. Click Done to add the choices to the list and return to the Properties pane. Optionally, do any of the following:
      • Choose one or more default values from the Default value drop-down menu.
      • Enter values for Min. choice and Max. choice. to set the minimum and maximum number of allowed choices.
      • Check the Include "Select all" option check box to allow editors to select all choices.
      • Check the Include "Other" option check box, then enter values for Option text and Placeholder text to allow editors to provide a value that is not listed.
    • For switch elements, under Switch values, provide values for Off value and On value. Choose a default value from the Default value drop-down menu.
  4. Format the properties of the choice form element.

Add attachments

If the layer owner has enabled attachments on the layer, editors can provide information such as audio, documents, and media. Attachment elements are listed in the Form elements list under Attachment and include the following:

Attachment elementInput typeDescription

General

  • Audio
  • Document
  • Photo
  • Video

Upload one or more attachment types in a single attachment element.

General attachment elements offer the most flexibility, and allow a number of different attachment types to be included in a single attachment element. You can limit the input types available.

Document

  • Document

Upload document file types, such as PDFs, Microsoft Excel spreadsheets, and Microsoft Word documents.

You can customize the Max. file size value. Options include: None, 1 MB, 5 MB, 10 MB, 100 MB, or Custom. The default file size is 10 MB.

Media

  • Audio
  • Photo
  • Video

Upload a specific media type for a given element.

Audio and video attachments are limited to a maximum duration of 10 minutes. You can also define the Max. duration value to limit the size of the attachment.

To add an attachment element to the form, complete the following steps:

  1. In the Attachment list, drag an attachment element to the form canvas.

    The attachment element is added to the form canvas.

  2. Format the properties of the attachment element.
    Note:

    For Media attachment elements, when the media source requires editors to capture or record new media only and there is a minimum file count of one or more files, the minimum file count requirement will only be enforced when editing the form on a mobile device.

    To learn more about formatting attachment elements, see Add attachment form elements in ArcGIS Field Maps.

Add descriptive text

You can add descriptive text to the form to provide contextual information or additional details about form elements. Descriptive text is read-only and cannot be altered by form editors.

To add a descriptive text element to the form, complete the following steps:

  1. Drag the Info element from the Form elements list to the form canvas.

    The Properties pane appears, where you can edit the descriptive text element.

  2. In the Formatting section, in the text editor, do any of the following:
    • Enter plain text in the text editor.
    • Use the text formatting tools to format the text.
    • Click Select field or expression Select field or expression or type {, and select a field or expression. Use this option if you want unique text for each field.
  3. In the Visibility section, add an Arcade attribute expression to apply rules for when the text should appear on the form. See the Configure conditional visibility section below for details.
  4. Close the Properties pane to commit your changes and return to the Form builder panel.
  5. Optionally, after you add a descriptive text element to the form, proceed with adding field elements.

Create groups of elements

To group related fields in the same physical location on the form, create a group element. Grouping elements is similar to placing questions in the same section on a paper form. Groups on digital forms have the added advantage that they can be contracted to show only the group heading until the form user expands the group.

For example, on a form to update content in a trails feature layer, create a group for all the fields related to trail properties, such as the trail name, type, and difficulty. You can create a separate group for the fields that record trail maintenance information, such as maintenance crew name, the date maintenance was last performed, and the description of the maintenance performed. If you choose to open the form with groups collapsed, the editors see only the two group names until they expand the groups.

To group related elements together on the form in a collapsible section, complete the following steps:

  1. Drag the Group element from the Form elements list to the form canvas.

    A form element is added to the form canvas.

  2. Drag related fields into the group.

    You can drag fields from the Fields list in the Form builder panel or from the form canvas.

  3. Select the group element to edit its properties.

    The Properties pane appears, allowing you to edit the following information:

    • Display name—Provide a name that describes the fields that are contained in the group. This is similar to a section heading on a paper form. This value is required.
    • Description—Provide a description for the group.
    • Initial state—By default, groups are expanded when the form opens, which means all fields are visible automatically. Uncheck the Expanded check box if you want the initial state of the group to be contracted. Form users will click the group to expand it and see the fields it contains.
    • Conditional visibility—Add an Arcade attribute expression to apply rules for when the group should appear on the form. See the Configure conditional visibility section below for details.

Tip:

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.

Add fields

Choose which fields in the layer to present to editors as form elements. In most cases, you add fields that the editors will use to update values.

For example, if the feature layer contains the following fields—Site Name, Site Type, Build Status, Landscaping, Edit Date, Editor Name, Creation Date, Creator Name, ID, and Shape—you might place only the Site Name, Site Type, Build Status, and Landscaping fields on the form because the Edit Date, Editor Name, Creation Date, Creator Name, and ID fields are automatically populated, and the Shape field is populated when editors add a feature to the layer.

You can also add fields for reference and disable editing on the form element. In the previous example, you might include the Edit Date field as an uneditable element on the form so the editors can see when the feature was last updated.

To add fields to the form, complete the following steps:

  1. To add fields from a layer as elements to the form do one of the following:
    • Add all fields to the form—Click Add all in the Fields list to include all the fields in the layer on the form. When you have a lot of editable fields in the layer, adding all the fields and removing one or two system or uneditable fields is faster than adding individual fields.
    • Add a selection of fields to the form—To include a specific selection of fields on the form, press the Ctrl key, click the fields to include, and drag them to the form canvas.
    • Add fields one by one—To add a single field to the form at a time, double-click it or drag it to the form canvas.

    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.

  2. Optionally, after you add fields as elements to the form, create groups or proceed with formatting field elements.

Add related record elements

If you created a relationship class in the geodatabase in ArcGIS Pro before publishing a hosted feature layer, if the hosted feature layer was created using a template that includes a relationship class, or the hosted feature layer was created for a form containing a repeated section in ArcGIS Survey123 Connect, you can add a related record element to the form. This allows users to view and add related records associated with the hosted feature layer, such as a table, while filling out the form.

Tip:

For instructions to create a relationship class in ArcGIS Pro, see the following help pages:

For example, on a form used to monitor urban tree health, a related table can include inspections of each tree. By adding a related record element to the form, you can add a new inspection to the related table while editing attributes for the tree feature.

Note:

  • A relationship class must exist for the data before a related record element can be added to the form.
  • To edit related records, the layer and its related tables or feature layers must be in the map, and each related table or layer must have editing enabled.
  • One-to-one and one-to-many relationship cardinalities between a feature class (origin) and table (destination) or feature class (destination) in the source data are currently supported.
  • Adding related record elements to the form is currently supported for hosted feature layers and hosted feature layer views. Hosted tables are also supported if they participate in a relationship that has a destination feature layer or table.

To add a related record element to the form complete the following steps:

  1. In the Related record list, double-click a related record element or drag it to the form canvas.

    The related record element is added to the form canvas.

  2. Format the properties of the related record element.

Add field groups

If the data owner configured contingent values for the data, the field groups will appear in the Field groups list next to the form canvas.

Note:

Contingent values can also be created in ArcGIS Pro. To learn more, see Create and manage contingent values.

Because the fields in a field group are related—the values of one field determine or limit what values you can set for the other fields—the contingent fields are added to the form in a group element when you add them from the Field groups list. Contingent fields should stay grouped together so editors can fill them in subsequently in Map Viewer. If you remove a field from its field group, a warning appears.

Field groups that share one or more fields are listed together. They are added to the form as one field group.

Field groups that you must add to the form appear in the Required section of the list. Field groups are required if they were configured as restrictive, which means the attribute values that editors provide when editing the fields in this field group must comply with the contingent value combinations.

Caution:

If you do not add required field groups to the form canvas, editors cannot use the form to edit the feature layer.

To add field groups to the form, complete the following steps:

  1. To add field groups to the form, do one of the following:
    • Add fields 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 a specific selection of field groups to the form, press the Ctrl key, click the field groups to include, and drag them to the form canvas.
    • Add all field groups to the form—Click Add all in the Field groups list to include all the fields in the layer on the form.

    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 field group.

  2. After you add field groups as elements to the form, format the group elements and format the field elements.

Apply formatting to form elements

When you select a form element on the form canvas, the Properties pane appears.

For basic, choice, and field elements, the Formatting section of the Properties pane shows properties that you can define for the element on the form. The sections below describe the properties you can define for elements on the form.

To apply formatting to groups, see Create groups of elements.

Note:

For field elements, some properties are inherited from the layer and cannot be altered for the form.

Define a display name

Every form element requires a value for the Display name setting. The display name is the label that accompanies the element on the form.

For fields, the default display name is the same as the field name. Accept the default or provide a more user-friendly or descriptive display name for each field.

Format text elements

If a form element references a string field, complete the following steps to format the element:

  1. Select a text form element to open the Properties pane.
  2. Click the Input type drop-down menu, and select one of the following options:
    • Barcode—This can be used only in apps that have a barcode reader. If you choose this input type, the element will revert to a single line of text in apps that cannot read barcodes as input, such as Map Viewer.
    • Text - Multiline—The input field on the form will be several lines high. Use this input type for text fields with a high maximum length to allow editors to see all text in the field.
    • Text - Single line—The input field on the form will show a single line of text.
  3. To display text in the field that prompts the editor for the correct value, provide that text in the Placeholder field.

    For example, you could type Type the applicant's first name as placeholder text for a field that stores the first name of the person applying for a loan.

    Placeholder text appears inside the input field element and is replaced by the text the editor provides.

    You cannot set placeholder text for a field that has a default value defined.

  4. In the Description field, provide text that explains what the values in the field represent.

    The description appears below the element on the form.

  5. Set values for Min. length (minimum character length) and Max. length (maximum character length) for the element.

    Sometimes, a feature layer is published with a default text field size rather than a length that makes sense for the field. For example, a field that can have only a finite number of values, such as yes, no, or unknown, might have a field length in the feature layer of 256 characters. But you can set a minimum and maximum of 1 if you want editors to type only y, n, or u when editing values in the field.

    You cannot set a maximum character length that is longer than the field length.

  6. Check the Required check box to define that editors must input a value to the field.

    See Define elements as required for more information.

  7. To prevent editors from using the form to update values in this field, uncheck the Editable check box.

    For example, you include a field for reference purposes, but you don't want editors to alter the values in the field.

Format date and time elements

To format elements that reference date and time fields, complete the following steps:

  1. Select a date and time form element to open its Properties pane.
  2. If the field is a date field type, click the Input type drop-down menu, and select one of the following options:
    • Date—This allows the editor to provide a date.
    • Date and time—This allows the editor to provide a date and time.
  3. In the Description field, provide text that explains what the values in the field represent.

    The description appears below the element on the form.

  4. For time only or timestamp offset elements, choose the time precision that the form will allow editors to input as follows:
    • hh—Allows editors to input hours.
    • hh:mm—Allows editors to input hours and minutes.
    • hh:mm:ss—Allows editors to input hours, minutes, and seconds.
      Note:

      Seconds can be stored in the field, though they will not display in ArcGIS Online.

  5. For date elements, optionally set values for the Start date and End date parameters to restrict a date range that editors can use.

    For example, for a date field in a new layer that records inspections that will be completed in the first quarter of the year, set the start date to the first day of the year and the end date to March 31 for the appropriate year.

  6. For date and time elements, optionally set values for the Start time and End time parameters.

    For example, for forms that are used during business hours only, you can restrict the start and end times so they do not fall outside your business hours.

  7. To allow editors to specify a time zone when editing timestamp offset elements, check the Allow users to set time zone check box.
  8. Check the Required check box to define that editors must input a value to the field.

    See Define elements as required for more information.

  9. To prevent editors from using the form to update values in this field, uncheck the Editable check box.

    For example, you include a field for reference purposes, but you don't want editors to alter the values in the field.

Format number elements

If the element uses a feature layer field that is a double, an integer, or a big integer data type, complete the following steps to format the form element:

  1. Select a text form element to open the Properties pane.
  2. Click the Input type drop-down menu, and select one of the following options:
    • Barcode—This can be used only in apps that have a barcode reader. If you choose this input type, the element will revert to the default input type in apps that cannot read barcodes as input, such as Map Viewer.
    • Number - Double—If the field in the layer is defined as a double, the app where the map will be used for editing does not accept a barcode as input, and editors must input decimal numbers, choose Number - Double.
    • Number - Integer—If the field in the layer is defined as an integer, a big integer, or a double, the app where the map will be used for editing does not accept a barcode as input, and editors should not input decimal numbers, choose Number - Integer.
  3. To display text in the field that prompts the editor for the correct value, provide that text in the Placeholder field.

    For example, you could type Type the applicant's first name as placeholder text for a field that stores the first name of the person applying for a loan.

    Placeholder text appears inside the input field element and is replaced by the text the editor provides.

    You cannot set placeholder text for a field that has a default value defined.

  4. In the Description field, provide text that explains what the values in the field represent.

    The description appears below the element on the form.

  5. Check the Required check box to define that editors must input a value to the field.

    See Define elements as required for more information.

  6. To prevent editors from using the form to update values in this field, uncheck the Editable check box.

    For example, you include a field for reference purposes, but you don't want editors to alter the values in the field.

Format an element that contains a list of three or more values

If the field in the feature layer has a list defined for it that contains three or more values, you can configure the form element to appear as a combo box or option buttons.

To format an element that contains three or more values, complete the following steps:

  1. Select a form element that references a field with a value list defined to open its Properties pane.
  2. In the Formatting section, click the Input type drop-down menu, and select one of the following options:
    • Combobox—Form users choose a value from a list of available options.
    • Radio buttons—All options appear on the form with option buttons next to them. Form users click the appropriate button.

    If the list contains a lot of values (for example, seven or more values), a combo box saves space on the form.

  3. In the Description field, provide text that explains what the values in the field represent.

    The description appears below the element on the form.

  4. Check the Required check box to define that editors must input a value to the field.

    See Define elements as required for more information.

  5. To prevent editors from using the form to update values in this field, uncheck the Editable check box.

    If the form element is not editable, the button or list option setting on the form shows the existing value for the attribute. If you add a feature, no value shows for the combo box or button elements unless the field has a default value defined.

Format elements with two possible values

If the field in the feature layer has a list defined for it that contains only two possible values, and the field has a default value set in the layer, you can define that element to appear as a toggle switch on the form or appear as a combo box or buttons.

If the field in the layer does not have a default value set, you can configure the element to appear as a combo box or buttons on the form.

To format elements with two possible values, complete the following steps:

  1. Select a form element that references a field with a two-value list defined and a default value defined to open its Properties pane.
  2. In the Formatting section, click the Input type drop-down menu, and choose one of the following options to present this element:
    • Combobox—Form users choose one of the values from a drop-down list.
    • Radio buttons—The two options appear on the form with buttons next to them. Form users click the appropriate button.
    • Switch—Form users turn on or turn off a toggle switch.

      You can change which value equates to an enabled switch by clicking the Switch order of values button next to the switch values.

      If the field does not have a default value set and you choose Switch for the input type, the element displays as a combo box on the form.

  3. In the Description field, provide text that explains what the values in the field represent.

    The description appears below the element on the form.

  4. Check the Required check box to define that editors must input a value to the field.

    See Define elements as required for more information.

  5. To prevent editors from using the form to update values in this field, uncheck the Editable check box.

    If the form element is not editable, the button, list option, or toggle switch setting on the form shows the existing value for the attribute. If you add a feature, no value shows for the combo box or button elements. For switch elements, the default setting is displayed on the form.

Format related record elements

You can customize how related record elements appear on the form by formatting their description, sort order, and the number that can be previewed.

To format related record elements, complete the following steps:

  1. Choose a related record element to open the Properties pane.
  2. In the Description field, provide text that explains what the values in the field represent.

    The description appears below the element on the form.

  3. Click the Sort by drop-down menu, and choose the field used to sort the related records.
  4. Click the Sort order drop-down menu, and choose how the related records should be sorted.

    If you sort by a string, double, or integer field, you can sort by ascending or descending value. If you sort by a date field, you can sort by the most recent or least recent value.

  5. Click the Preview count drop-down menu, and choose the number of related records that can be previewed on the form.

    Choosing a value greater than three may require additional scrolling on the form and is not recommended.

Note:

You can create a separate form for the related table, and choose which fields from the related table to display and how to format them.

Define elements as required

To enforce the input of data for a field, you can configure form elements so that they require an entry. For example, if all applications require a submission date, configure the submission date element to be required.

When editors use the form, they see an asterisk next to the fields that require input, and they cannot save their edits until a value is provided.

To define elements as required, complete the following steps:

  1. Click a field form element to open its Properties pane.
  2. In the Logic section, check the Required check box.

    A * Required chip appears on the form element, indicating that editors must supply a value for this field.

Add logic to make the form conditionally dynamic

You can make the form dynamic based on the following logical conditions that you define using the ArcGIS Arcade expressions:

Once defined, you can reuse expressions for other form elements.

Configure conditional visibility

You can conditionally show or hide form elements 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:

  1. Click a field form element to open its Properties pane.
  2. In the Logic section, click the Expressions button Expressions next to the Visible check box.

    The Expressions pop-up appears, displaying expressions previously created for the form.

  3. Click New expression.

    The Expression builder window appears. The builder allows you to write and preview an expression in Arcade before saving it to the selected form element.

  4. In the Title text box, add a title for the expression.
  5. Define the expression.

    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"

    Map Viewer applies the Arcade Form 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 on the form.

  6. Click Done to close the expression builder.

    A </> Visibility chip appears on the form element, indicating that the conditional visibility expression has been applied to the group or field.

Now that you created the expression, you can apply it to any form element. You can see which elements are using the expression by clicking the number next to the expression in the Expressions pop-up. See the Reuse expressions section below to learn more.

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 Arcade from this menu.

Configure conditionally required elements

You can conditionally require form elements based on previous values entered on the form. For example, a debris description field should only be required if the length of the storm debris is greater than 3 meters.

To configure conditionally required elements, complete the following steps:

  1. Click a field form element to open its Properties pane.
  2. In the Logic section, click the Expressions button Expressions next to the Required check box.

    The Expressions pop-up appears, displaying expressions previously created for the form.

  3. Click New expression.

    The Expression builder window appears. The builder allows you to write an expression and preview it in Arcade before saving it to the selected field or group.

  4. In the Title text box, add a title for the expression.
  5. Define 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 debris description field only needs to be required if the debris is greater than 3 meters, the following condition can be used to build the expression:

    • Field name—debris_length
    • Operator—is greater than
    • Value—3

    The following is the same expression in Arcade syntax:

    ($feature, "debris_length") > 3

    Note:

    To create more complex expressions, click Launch Arcade editor.

    When you apply multiple conditions to the same element, you can choose whether all conditions must be true or only one condition must be true for the form element to be required.

    ArcGIS Online applies the Arcade Form Constraint profile to evaluate whether a feature meets the criteria defined in the expression. If a value less than 3 is entered in the debris length field, the debris description field will not be required on the form.

  6. Click Done to close the expression builder.

    A </> Required chip appears on the form element, indicating that the required expression has been applied.

Now that you created the expression, you can apply it to any form element. You can see which elements are using the expression by clicking the number next to the expression in the Expressions pop-up. See the Reuse expressions section below to learn more.

Note:

You can duplicate, edit, or delete the expression at any time using the overflow menu in the Expressions pop-up. To edit the expression using Arcade, click Edit Arcade from this menu.

Configure conditional editing

You can conditionally enable editing for form elements based on previous values entered on the form. For example, editors should only edit values in a date_pipe_replaced field if the value for the pipe_replaced field value is set to yes.

To configure conditional editing, complete the following steps:

  1. Click a field form element to open its Properties pane.
  2. In the Logic section, click the Expressions button Expressions next to the Editable check box.

    The Expressions pop-up appears, displaying expressions previously created for the form.

  3. Click New expression.

    The Expression builder window appears. The builder allows you to write an expression and preview it in Arcade before saving it to the selected field or group.

  4. In the Title text box, add a title for the expression.
  5. Define 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 the date for a pipe replacement should only be editable if an the pipe_replaced field value is yes, the following condition can be used to build the expression:

    • Field name—pipe_replaced
    • Operator—is
    • Value—yes

    Here is what the same expression looks like in Arcade syntax:

    ($feature, "pipe_replaced") == "yes"
    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 editable.

    ArcGIS Online applies the Arcade Form Constraint profile to evaluate whether a feature meets the criteria defined in the expression. If a value other than 4367 is entered in the inspector ID field, the pipe ID field will not be editable on the form.

  6. Click Done.

    An </> Editable chip appears on the form element, indicating that the required expression has been applied.

Now that you created the expression, you can apply it to any form element. You can see which elements are using the expression by clicking the number next to the expression in the Expressions pop-up. See the Reuse expressions section below to learn more.

Note:

You can duplicate, edit, or delete the expression at any time using the overflow menu in the Expressions pop-up. To edit the expression using Arcade, click Edit Arcade from this menu.

Add expressions to calculate field values

You can add a calculated expression to the form to calculate and populate data automatically. This saves time for editors and enforces data integrity by automating the calculation of the field value.

Use Arcade to build calculated expressions based on feature attributes and geometry. For example, you can add a calculated expression to a field that stores dates for a bridge inspection schedule. When the editor sets the bridge condition field's value to damaged, for example, the expression defined on the inspection date field can automatically schedule the next inspection to take place in a week's time by populating the bridge inspection field with that date.

Calculated expressions are dynamic, meaning they automatically update the form as information changes. As a result, editors can see the updated calculation before submitting the form. Because the value in the calculated expression field is populated by the expression, editors cannot provide a value for that field on the form.

To create a calculated expression, complete the following steps:

  1. Click a field form element to open its Properties pane.
    Caution:

    If editing is enabled for the form element, the expression will not run.

  2. In the Logic section, click the Expressions button Expressions in the Calculated value section.
  3. Click New expression.

    The Arcade editor window appears. The editor allows you to write and test an expression before saving it to the selected form element.

  4. In the Title text box, add a title for the expression.
  5. 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 in the next section.

    if (IsEmpty(Geometry($feature))){
        return;
    }
    else{
        Area($feature, 'square-meters')
    }
    To learn more about calculating area with Arcade, see Area (Geometry Functions).

    For a list of all the functions offered in Arcade, see the Arcade Function Index.

  6. Click Run to test the expression and ensure that it doesn't result in an error.
  7. Click Done to close the Arcade editor.

    A </> Calculated chip appears on the form element, indicating that the calculated expression has been applied.

Now that you have created the 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.

Calculated expression examples

The following are examples of calculated expressions:

  • Provide date information—The following expression provides the current date for a date field:
    return Today();
    To learn more about date information you can access with Arcade, see Date Functions.
  • Extract information from intersecting layers—The following expression is applied to a ZIP code field on the form and extracts a ZIP code value from an intersecting parcel layer:
    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);
         }
    }
    To learn more about extracting information from intersecting layers with Arcade, see Intersects (Geometry Functions).

For a list of all the functions offered in Arcade, see the Arcade Function Index.

Reuse expressions

After you create an expression, you can reuse it across form elements. For example, you can conditionally display one form element based on the same expression used to require another, and you can use the same calculation to populate multiple fields.

To use existing expressions for form elements, complete the following steps:

  1. While configuring the form, click a form element to open the Properties pane.
  2. In the Logic section, click the Expressions button Expressions next to the type of expression you want to add.

    The Expressions pop-up or Calculate expressions pop-up appears, displaying expressions previously created for the form.

    Tip:

    The number next to the expression indicates the number of form elements the expression is currently applied to. Clicking this number opens another pop-up that displays the form elements and their properties that are currently using the expression.

    You can remove the expression from any form element property by clicking the X on the chip displaying the expression type.

  3. Select the expression you want to apply.

    A chip appears on the form element, indicating that the expression has been applied.

Save the form

When you finish editing, save the form. Click OK to close the Configure form window, and save the form to the map or to the layer as follows:

  • Save to the map—If the form is unique to a specific map, and you don't want to reuse it across other maps, save changes to the map. The form is saved to the map and won't appear in other maps that contain the layer.
  • Save to the layer—To reuse the form across maps that contain the layer, save changes to the layer. The form is saved to the layer and can be reused across other maps.
Note:

Form changes that are saved to the map override form changes that are saved to the layer.

To save changes to the layer, you must own it, be a member of the default administrator role, or be a member of a custom role that has the following privileges:

  • Administrative privileges: Members: View all
  • Administrative privileges: Content: View all
  • Administrative privileges: Content: Update