Select to view content in your preferred language

How to add a clickable URL in a popup (attribute rule / Arcade expression) that zooms to another feature.

1024
2
Friday
Labels (1)
JoseSanchez
Frequent Contributor

Good afternoon,

I’m looking for a way to show the nearest parking location (point layer) when clicking on a restaurant (point layer). I’d like the pop‑up in ArcGIS Pro to display a clickable URL or an Arcade expression that zooms to the nearest parking feature. The layer restaurant  already includes a NEARME field that stores the ID and distance of the closest parking point.


Tried thos code as an expression and it does not work:

var parkingOID = $feature.NEAR_FID;

if (IsEmpty(parkingOID)) {
return "No parking location found.";
}

var layer = FeatureSetByName($map, "Parking_Locations", ["OBJECTID"], false);
var parkingFeature = First(Filter(layer, "OBJECTID = " + parkingOID));

if (IsEmpty(parkingFeature)) {
return "Parking location not found in layer.";
}

// Build a link that auto-selects/highlights the parking feature
var url = "arcgis://select/?layer=Parking_Locations&objectid=" + parkingOID;

return "Select Parking Location: " + url;

 

2 Replies
Robert_LeClair
Esri Esteemed Contributor

I don't know of a usuable workflow to do this in ArcGIS Pro, but I definintely know how to do this in ArcGIS Experience Builder.  Perhaps others will chime in with assistance.

0 Kudos
iMike4U
New Member

Hey, your logic looks fine but the issue is that ArcGIS pop-ups don’t really support  links like that in most cases. Instead, try using a feature action or configure the pop-up with a related record or custom attribute display rather than forcing a URL. Also double check your layer name in FeatureSetByName matches exactly, that breaks things a lot. If you just want zoom/highlight, setting up a selection action in the map might be a cleaner way than Arcade.

0 Kudos