Arcade expression to control if popup opens or not?

317
3
02-08-2023 03:18 PM
Paco
by
Occasional Contributor

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

0 Kudos
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.

You could have an Arcade expression that simply hides the popup contents for certain features. It would still give you a blank popup, though.

- Josh Carlson
Kendall County GIS
Paco
by
Occasional Contributor

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!

0 Kudos
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, you could do 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 to 1, the others are at 0. 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

This leaves you with those pesky blank 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
0 Kudos