I have a polygon layer with two overlapping grids, each with different inspection intervals - Distribution (36 months) and business districts (12 months). How can I ensure that my meter inspections check if they are located within a business district and pull the correct inspection interval? Currently, the inspections are only pulling the green polygon with a 36-month interval.
var point = Geometry($feature);
var polygon_layer = FeatureSetByName($map, 'Leak Survey Area');
var polygons = Intersects(polygon_layer, point);
if (Count(polygons) > 0) {
for (var f in polygon_layer){
return f.interval
}
}
else {
return 36;
}
return (Count(polygons) > 0)