Hi David Krady ,
When you configure an Arcade expression for a pop-up that should appear when clicking on a feature, you do not have access the actual location where the user clicked. You will only have the clicked feature geometry and not the exact location. (I hope this will be provided at some point in the future).
In your case the expression contains a loop and you use the return inside the loop. When the sequence hits the return, it will exit the arcade expression. So, you will only have the first feature (attribute) it found in the process. To return multiple features, you will need to use a variable that you populate with the results and return that variable after the loop.
Have a look at the example below:
var intersectLayer = Intersects(FeatureSetByName($map, "Deer Management Zones"), $feature);
var cnt = Count(intersectLayer);
var result = "DMZ(s) found:"
if (cnt > 0) {
for (var f in intersectLayer){
result += TextFormatting.NewLine + " - " + f.DMZ;
}
} else {
result = "no DMZs found..."
}
return result;