Is it possible to apply conditional visibility per attribute for feature popups in Field Maps?

380
0
03-08-2023 03:11 PM
VincentLantaca
New Contributor III

I have a custom JSON template for a web map that I am using in Field Maps.

For a layer in the map, I can have conditional visibility in a feature creation/edit form using an Arcade expression for the "visibilityExpression" configuration. It works and the visibility is toggled as expected based on the Arcade Expression:

 

"formInfo": {
    "formElements": [
        {
            "label": "MyAttribute",
            "type": "field",
            "visibilityExpression": "expr1",
            "editable": true,
            "fieldName": "MyAttribute",
            "inputType": {
                "type": "text-box",
                "minLength": 0
            }
        }
    ],
    "expressionInfos": [
        {
            "expression": "DomainName($feature, \"TYPE\") == \"TYPE1\"",
            "name": "expr1",
            "returnType": "boolean",
            "title": "Attribute Expression"
        }
    ]
},

 

however, it seems like it doesn't work for the regular popup that comes up when you tap a feature in Field Maps. I have tried applying "visibilityExpression" for "popupInfo", but it doesn't work for me:

"popupInfo": {
    "popupElements": [
        {
            "type": "fields"
        },
        {
            "type": "attachments",
            "displayType": "auto"
        }
    ],
    "fieldInfos": [
        {
            "fieldName": "MyAttribute",
            "format": {
                "digitSeparator": false,
                "places": 2
            },
            "isEditable": true,
            "label": "MyAttribute",
            "tooltip": "",
            "visibilityExpression": "expr1"
        }
    ],
    "expressionInfos": [
        {
            "expression": "DomainName($feature, \"TYPE\") == \"TYPE1\"",
            "name": "expr1",
            "returnType": "boolean",
            "title": "Attribute Expression"
        }
    ]
}


Is there a way to control the visibility for normal popups in Field Maps?

0 Kudos
0 Replies