I am trying to create a script on a wildfire boundary layer (polygon) that will return the name of every county it touches, so users can select a fire parameter and know what counties are affected. I had this working a while back and I provided what I had below, but now it returns nothing but a blank row. Any ideas? I'm not set on the expression below if there is a better solution.
var counties = FeatureSetByName($map,"USA Counties (Generalized)");
var intersectFires = Intersects(counties, $feature);
var uniqueFires = [];
for (var feat in intersectFires) {
if (IndexOf(uniqueFires, feat) == -1){
uniqueFires[Count(uniqueFires)] = [" " + feat.NAME];
}
}
return uniqueFires