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 apply
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.
...
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"
}
]
}
]
}
...