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