I'm trying to configure a popup for a polygon feature class so that when clicked attributes from a point feature class show up. For example, if I had 10 clients living in the USA, if I clicked on the USA polygon, the names of those 10 clients would appear in the popup.
So far, I can only get it to display the first value of only the firstname (first and last names are in different fields of the point layer):
var intersectLayer =Intersects(FeatureSetByName($map,"Origins"), $feature)
for (var f in intersectLayer){
return f.first_name; " "; f.last_name;
}
right now it returns:
custom: John
but I would like it to return:
John Smith
Lucy Stone
Sam Addams
Butch Cassidy
And so on.
Tried gleaning something from this but the code provided doesn't seem to work with my layers: