Portal 11.3
I have a field in the Web Map pop-up window that I would like to show/hide based on the field content: If the field is populated with data - I'd like the field to show up. If the field contain no data - I'd like that field to be hidden.
If found this script online, but it does not seem to work (I changed the $feature.FieldName to the appropriate field name).
IIf(IsEmpty($feature.FieldName) || $feature.FieldName == 'N/A', "none", "inline")
So in the example below, I would like the field named "ITS Host" to be hidden in the pop-up when there is no data.
Hi @doronwen,
To achieve what you want, I do not think is possible via the default Field List (at least on 11.3, have not tested ArcGIS Online or Latest ArcGIS Enterprise releases).
Instead you can create an Attribute Expression with the following Arcade Expression:
var val = $feature.placename;
if (IsEmpty(val) || val == null || Trim(val) == "") {
return null; // hides the field in the pop-up
} else {
return "ITS Host: " + val;
}Once you have done this, remove the Field from displaying on the Field List and then on the Pop-ups add a Text element and reference your Attribute Expression like {expression/expr0}
Regards,
Glen