Is it possible to hide a popup based on attribute?

148
3
2 weeks ago
AngelaSchirck
Occasional Contributor II

Hi all,

I am using WebMap Viewer and would like to had a popup for certain attributes.  I have Parcel Control Numbers (PCNs) that are 17-digits and 10-digits.  I want to hide the popup info for the 10-digit PCNs since this leads to bad links.  Does any one know a way to do this?  I'm not afraid of a little programming (python, arcade) if that is what it takes.  

Thanks!

 

0 Kudos
3 Replies
CodyPatterson
Occasional Contributor III

Hey @AngelaSchirck 

You can enter an expression and show that field as having data when meeting a condition, I haven't found a way to conditionally enable pop-ups if that's what you're mentioning.

You can use this here to find the count, and this would match your specific use-case:

var <your var> = $feature.<feature name>;

if (Count(<your var>) <= 10) {
    return <your var>;
} else {
    return "";
}

You can hit "Select fields" and then "Add expression" to do this. I would disable the viewing of the original ID and give this one a similar name for use!

CodyPatterson_0-1714737954717.png

Hope this helps!

Cody

0 Kudos
AngelaSchirck
Occasional Contributor II

Thanks Cody, 

I'll give it a try.  I tried just adding a filter to the layer, but there's no option to write code in the filter, you have to just pick from a set of options which don't include "string length." 🙂

0 Kudos
CodyPatterson
Occasional Contributor III

Hey @AngelaSchirck 

I've attached a GIF that explains what I did , hopefully that helps! If it doesn't end up showing what you need, could you attach a screenshot of what you're attempting to do?

arcade.gif

Hope that helps!

Cody

0 Kudos