Geographic Information Systems Asked by Markopoulou Dionysia on January 6, 2021
I have a layer and I am configuring pop-ups, but in one specific field – Name, I have blank records which I don’t want to include them in the pop -ups.
Does anyone knows how to create the expression, when the field is blank to hide the entire field? Otherwise to show the information about the name.
The article Russ mentioned above is a nice way to go if you are want to configure a nice look to the Popup. If you're looking for a quick way without much configuration you can go with something like this:
var skipFields = ['Creator', 'CreationDate', 'Editor', 'EditDate', 'OBJECTID', 'GlobalID'];
var allFields = '';
for(var i in $feature){
var skip = False;
for(var j in skipFields){
if(Text(i) == Text(skipFields[j])){
skip = True;
}
}
if(isEmpty($feature[i])){
Console(Concatenate('Null Field: ', i));
} else if (skip){
Console(Concatenate('Skipping Field: ', i));
} else {
Console(Concatenate('Including Field: ', i));
allFields = Concatenate([allFields, Upper(i), TextFormatting.NewLine, Text($feature[i]), TextFormatting.NewLine, TextFormatting.NewLine]);
}
}
Console(allFields);
return allFields;
It returns a basic output as below:
Quick but a little raw!
Answered by MKelly on January 6, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP