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<SPAN class="operator token">=</SPAN> FeatureSetByName<SPAN class="punctuation token">(</SPAN>$map<SPAN class="punctuation token">,</SPAN><SPAN class="string token">"layer"</SPAN><SPAN class="punctuation token">)</SPAN>
var buff <SPAN class="operator token">=</SPAN> buffer<SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">Geometry</SPAN><SPAN class="punctuation token">(</SPAN>$feature<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="number token">05</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'miles'</SPAN><SPAN class="punctuation token">)</SPAN>
var sales <SPAN class="operator token">=</SPAN> <SPAN class="token function">count</SPAN><SPAN class="punctuation token">(</SPAN>intersects<SPAN class="punctuation token">(</SPAN>var1<SPAN class="punctuation token">,</SPAN> buff<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">return</SPAN> sales<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Any help would be greatly appreciated!