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",
      "editable": true
    },
    {
      "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"
    }
  ]
}

Example

{
  "title": "Form with all element types",
  "expressionInfos": [
    {
      "name": "expr1",
      "title": "Is Tall Tree",
      "expression": "$feature.tree_height > 50",
      "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"
          }
        }
      ]
    },
    {
      "type": "group",
      "label": "Physical Characteristics",
      "formElements": [
        {
          "type": "field",
          "fieldName": "tree_height",
          "label": "Tree Height"
        },
        {
          "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": "expr1"
        }
      ]
    },
    {
      "description": "Inspection Reports",
      "displayCount": 3,
      "displayType": "list",
      "editable": true,
      "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.