You are using a browser that is no longer supported. Please use the latest version of Google Chrome, Mozilla Firefox, Apple Safari, or Microsoft Edge. For more information please see the System Requirements.

Unsupported browser

You are using a browser that is not supported. JavaScript API works on the latest versions of Google Chrome, Mozilla Firefox, Apple Safari, or Microsoft Edge. Use one of these browsers and provide your feedback through GeoNet, the Esri Community.

  • {i18n.unsupportedBrowser.chrome}
  • Firefox
  • Safari
  • undefined
Loading...

Note: Support for 3D on mobile devices may vary, view the system requirements for more information.

This sample demonstrates how to use FeatureLayer.applyEdits() to update attributes of existing features. This sample uses the FeatureForm widget to update attributes of existing features by calling the applyEdits function when a user selects a feature on the view.

The form's fields are configured via a form template. This template accepts an array of field elements combined in a group. Having grouped field configurations provides a more manageable editing workflow. This sample uses nested elements which autocast to group elements.

Prior to version 4.16, formatting fields and groupings was handled via FieldConfig and/or FieldGroupConfig configurations. Moving forward, the preferred way is through setting a feature layer and/or form's formTemplate property. This property accepts an array of field and/or group elements.

...
formTemplate: { // Autocasts to new FormTemplate
  title: "Damage assessments",
  description: "Provide information for insurance",
  elements: [
    { // Autocasts to new GroupElement
      type: "group",
      label: "Inspector Information",
      description: "Field inspector information",
      elements: [
        { // Autocasts to new FieldElement
          type: "field",
          fieldName: "inspector",
          label: "name"
        },
        {
          type: "field",
          fieldName: "inspemail",
          label: "Email address",
          visibilityExpression: "alwaysHidden" // reference to an expression defined under "expressionInfos"
        },
        {
          type: "field",
          fieldName: "insp_date",
          label: "Date of inspection"
        }
      ]
    }
  ]
}
...

Sample search results

TitleSample
Loading...