I'm working on creating pop-ups for my Units for ArcGIS Indoors. My zones layer displays lease polygons. When I click on the pop-up for the Units I would like the corresponding zone "Long Name" to appear in the pop-up. I started with this code, but I'm missing something
var intersectLayer =Intersects(FeatureSetByName($map,"Zones"), $feature)
for (var f in intersectLayer){
return f.NAME_LONG
}
Since the polygons are multiple stacked floors the correct zone isn't always returned, it returns whatever zone is on top or the highest floor. I need something else to only have the zone that is on the same floor as the unit to be returned.