I am using FormTemplate in a FeatureForm to show elements from a Featurelayer, which works fine. But when I try to replace the field with a calculated expression using the FormTemplates ExpressionInfos, nothing happens and the value from the Featurelayer field is still showing. I have tried with 4.27 and 4.28 and I get no errors in console.
const featureForm = new FeatureForm({
view: view,
layer: MyLayer,
feature: view.popup.selectedFeature,
formTemplate: {
expressionInfos: [
{
name: 'Test',
title: 'Test',
expression: '$feature.Field2',
returnType: 'string',
},],
elements: [
new FieldElement({
type: 'field',
fieldName: 'Field1',
label: 'Label: ',
valueExpression: 'Test',
}),],},})
So, in this simplified example I would like to display the Field2 value (as calculated in the expression) instead of Field1 but Field1 is still displayed. Of course, my plan is to perform a more complex expression once I get this to work. Can someone help?