Hi,
I'd like to auto-fill the county for the current location when I create a feature in AGOL (New) Map Viewer, following the general approach laid out here: https://community.esri.com/t5/arcgis-online-blog/overlapping-features-in-pop-ups-quick-introduction/ba-p/890862
Here's what I have:
var Counties=Intersects(FeatureSetByName($map,"USA Counties (Generalized)"),$feature)
for (var county in Counties){
return county.NAME
}
In the Arcade editor inside Field Maps editor, the "Test" button confirms the proper syntax and returns the correct (single) value. However, when I create a feature in the AGOL (New) Map Viewer, nothing shows up in this field.
I've isolated that the Intersects (or FeatureSetByName) function is causing issues, though I'm not sure what the problem is. The following troubleshooting example returns nothing in AGOL (it should always return "test"):
var Counties=Intersects(FeatureSetByName($map,"USA Counties (Generalized)"),$feature)
return "test"
I did confirm that the following code works, just as a sanity test:
return "test"
Oh, and I did try the FeatureSetByID function instead of FeatureSetByName, with similar results.
Any help would be greatly appreciated.