formInfo

Defines the form configuration when a user edits a feature.

Referenced by: Feature Layer (ArcGISFeatureLayer), Footprint Layer (FootprintLayer), Oriented Imagery Layer (OrientedImageryLayer), Subtype Layer (SubtypeLayer), Subtype Table (SubtypeTable), table

Properties

Property Details
description A string that appears in the body of the form as a description.
expressionInfos[] List of Arcade expressions used in the form.
formElements[] An array of formElement objects that represent an ordered list of form elements.
Array of items of the following types:
preserveFieldValuesWhenHidden Determines whether a previously visible formFieldElement value is retained or cleared when a visibilityExpression applied on the formFieldElement or its parent formGroupElement evaluates to false. Default is false.
title A string that appears at the top of the form as a title.

Example

{
  "title": "Form with just fields",
  "formElements": [
    {
      "type": "field",
      "fieldName": "tree_type",
      "label": "Tree Type",
      "description": "The type of the tree",
      "inputType": {
        "type": "combo-box"
      },
      "hint": "e.g. apple, pear, pine",
      "editableExpression": "expr3"
    },
    {
      "type": "field",
      "fieldName": "height",
      "label": "Height of the tree",
      "description": "The height of the tree in feet",
      "inputType": {
        "type": "text-box"
      },
      "requiredExpression": "expr1"
    },
    {
      "type": "field",
      "fieldName": "needs_trimming",
      "description": "Indicates the tree needs to be trimmed",
      "domain": {
        "type": "codedValue",
        "name": "Needs Trimming",
        "codedValues": [
          {
            "name": "Yes",
            "code": "yes"
          },
          {
            "name": "No",
            "code": "no"
          }
        ]
      },
      "inputType": {
        "type": "combo-box"
      },
      "visibilityExpression": "expr2"
    }
  ],
  "expressionInfos": [
    {
      "name": "expr1",
      "title": "Is Pine Tree",
      "expression": "$feature.tree_type == 3",
      "returnType": "boolean"
    },
    {
      "name": "expr2",
      "title": "Tall Tree",
      "expression": "$feature.height >= 50 ",
      "returnType": "boolean"
    },
    {
      "name": "expr3",
      "title": "Is Editable",
      "expression": "true",
      "returnType": "boolean"
    }
  ]
}

Example

{
  "title": "Form with all element types",
  "expressionInfos": [
    {
      "name": "expr1",
      "title": "Is Tall Tree",
      "expression": "$feature.tree_height > 50",
      "returnType": "boolean"
    },
    {
      "name": "expr3",
      "title": "Is Editable",
      "expression": "true",
      "returnType": "boolean"
    }
  ],
  "formElements": [
    {
      "type": "group",
      "label": "Tree Information",
      "formElements": [
        {
          "type": "field",
          "fieldName": "tree_type",
          "label": "Fruit Type",
          "inputType": {
            "type": "radio-buttons"
          }
        },
        {
          "type": "attachment",
          "attachmentKeyword": "image-of-tree",
          "label": "Image of tree",
          "description": "Take a photo of the tree",
          "inputType": {
            "type": "image",
            "inputMethod": "any"
          }
        }
      ]
    },
    {
      "type": "group",
      "label": "Physical Characteristics",
      "formElements": [
        {
          "type": "text",
          "text": "**Before performing measurement**\n\n1.  Check for presence of wires or cables before use of tape measure or other physical device\n2.  Measure from base of tree to top of crown",
          "textFormat": "markdown"
        },
        {
          "type": "field",
          "editableExpression": "expr3",
          "fieldName": "tree_height",
          "label": "Tree Height",
          "inputType": {
            "type": "text-box"
          }
        },
        {
          "type": "field",
          "fieldName": "needs_trimming",
          "description": "Indicates the tree needs to be trimmed",
          "domain": {
            "type": "codedValue",
            "name": "Needs Trimming",
            "codedValues": [
              {
                "name": "Yes",
                "code": "yes"
              },
              {
                "name": "No",
                "code": "no"
              }
            ]
          },
          "editableExpression": "expr3",
          "inputType": {
            "type": "combo-box"
          },
          "visibilityExpression": "expr1"
        }
      ]
    },
    {
      "description": "Inspection Reports",
      "displayCount": 3,
      "displayType": "list",
      "editableExpression": "expr3",
      "label": "Inspections",
      "orderByFields": [
        {
          "field": "inspectionDate",
          "order": "desc"
        }
      ],
      "relationshipId": 0,
      "type": "relationship"
    }
  ],
  "preserveFieldValuesWhenHidden": false
}

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

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close