I am just starting to develop in Arcade in ArcGIS Online. I am testing the clip function and can't seem to get the syntax right. Using the example:
var envelope = Extent({ ... });
Area(Clip($feature, envelope), 'square-miles');
I created a simple web map and added 2 layers. 'Area of Interest' and 'Parcels'. I want to clip the parcels by the Area of Interest. So, I set my code like this:
var aoi = Extent(FeatureSetByName($map, "Area of Interest"))
var clp = Clip($feature, aoi)
return Round(Area(clp, 'hectare'), 2);
Yet, I keep getting an error:
Execution Error:JSON.parse: unexpected character at line 1 column 2 of the JSON data
I've googled around, and changed syntax in various ways, but I can't seem to get it to work. Can anyone suggest what is going wrong? What is the proper syntax to clip one layer by another?
Thanks