I have an Arcade expression in AGOL Experience Builder where I'm trying to intersect two layers: a point layer named sites and a polygon layer named counties. I want to get the count of counties that have a site in them.
I retrieve each layer using FeatureSetByPortalItem (since apparently ExB has no profile variables like $map) and include geometry. This works fine for both layers. But the code
var result = Count(Intersects(counties, sites));
gives the error "Test execution error: Execution error - Invalid parameter. Verify test data.". What is the problem here, and is there a way to fix or get around it? Thanks!