0

I'm trying to write an expression for a pop up in ArcGIS Online that will display the non-empty field names and attributes. I adapted the following script that I found online here

var returnstring = "List of All Values"+TextFormatting.NewLine
for (var i in $feature) {
    returnstring = returnstring + i + ": " + $feature[i] + "; " + TextFormatting.NewLine
}
return returnstring
0

never mind! a colleague answered it. It should be:

var returnstring = "List of All Values"+TextFormatting.NewLine

for (var i in $feature) {
    if (!isEmpty($feature[i])){
        returnstring = returnstring + i + ": " + $feature[i] + TextFormatting.NewLine
    }
}
return returnstring 
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.