I'm new to Arcade and trying to figure out how to reference other layers when calculating fields in Pro. Specifically, i am attempting to use arcade to determine which points from one layer fall within a polygon from another using the intersects function. I've been able to do this in ArcGIS Online using Featuresetbyname and $map to call different layers but it doesn't seem to translate. I know the example below also incorporates a buffer but i'm basically trying to recreate line 1 in pro.
var var1= FeatureSetByName($map,"layer")
var buff = buffer(Geometry($feature),.05,'miles')
var sales = count(intersects(var1, buff))
return sales
Any help would be greatly appreciated!