Select to view content in your preferred language

Prevent fields with NULL values from showing up in pop-up window

6628
4
03-27-2020 10:44 AM
DanHoffman1
Occasional Contributor

Hello,

I have a layer in a web map that has about 30 fields in it, and I'd like to show only those fields that do not show NULL values.  As shown in the screenshot below, the ideal outcome is to show only the field names and values that have a value, so there aren't a bunch of blank records.  Full disclosure...programming is not my strong suite!  I've been poking around with google searches on how to use Arcade to filter out empty values from an array of fields, and using 'IIF' statements, but haven't quite found exactly what I'm looking for.  If any of you have a custom-configured Arcade script from a web map where you filtered out the NULL values you'd be willing to share it would be greatly appreciated!

0 Kudos
4 Replies
Katie_Clark
MVP Regular Contributor

You mentioned you've searched some sites for a solution....did you look at this blog post, by chance?

https://community.esri.com/community/gis/web-gis/arcgisonline/blog/2017/07/18/conditional-field-disp... 

It would be a bit tedious to set up, but it seems like it would do exactly what you're looking for. 

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
0 Kudos
DanHoffman1
Occasional Contributor

Thanks Katherine.  I did see that post, but I'm kind of a lazybones and didn't want to set up an expression for each field, so I was hoping for something easier.  This seems like it could work though if nothing else comes up.  Thanks!

0 Kudos
JoeBorgione
MVP Emeritus

Take a look at this thread from 2019; you might find what you are looking for:

https://community.esri.com/thread/233503-can-i-eliminate-empty-values-using-arcade-in-my-pop-up 

That should just about do it....
0 Kudos
DanHoffman1
Occasional Contributor

This looks promising.  I will give this a try later today, thank you!

0 Kudos