Arcade expression to control if popup opens or not?

194
3
02-08-2023 03:18 PM
Labels(1)
Paco
by
New Contributor III

Hello all!

Wondering if an Arcade expression could control if a Popup opens or not?

on selection of Feature, if Attribute is NULL then open Popup else do not open Popup.

thanks!

p

0Kudos
3 Replies
jcarlson
MVP Esteemed Contributor

The short answer is "no". Enabling popups is done at the layer level, and cannot be dynamically toggled per feature.

Youcouldhave an Arcade expression that simply hides the popupcontentsfor certain features. It would still give you a blank popup, though.

- Josh Carlson
Kendall County GIS
Paco
by
New Contributor III

Yep. i kindof had a feeling. do we think there's a way to option the Arcade expression to put the popup I want, "on top" of the popup list?

"if attribute is YES, open popup first(on top), then remove all other attributes from the undesired feature popups below it" leaving one attributed popup and a list of blank popups 'below' it.

or any other ideas?! thanks all!

0Kudos
jcarlson
MVP Esteemed Contributor

Unfortunately, no. The popups seem to only go in descending order on the objectid, regardless of your layer's feature display order. So the newest feature's popup will show up first, no matter what.

Now, youcoulddo something like load the map into an app that combines all the popups into a single panel, like Zone Lookup or something. Here's an example. I have three overlapping features. One of them has an integer field set to1, the others are at0. I will use the following Arcade element in the popup:

if ($feature.some_int == 1) { return { type : 'text', text : 'Here is the popup I want' } }

This results in a popup that for the 0s is completely blank.

Now I load this map into a Zone Lookup App.

jcarlson_1-1675959959380.png

这让你和那些讨厌的空白boxes, but you still get a single location for all your popups, and the one with the desired attribute will show up somewhere in the list.

- Josh Carlson
Kendall County GIS
0Kudos