I have two layers on my Dashboard App. One consists of polygons and other polylines with same map extent but have no common fields. I need to count the polylines present in the polygon when user clicks on one or polygon selection changed. I believe I need to apply spatial query for this but don't know how to do it on Dashboard
In the map widget settings, go to Layer Actions. For your polygon layer, select Add action → Filter. Select the other layer you want to be filtered, and set the Method to Spatial.
Forgot to mention! If your layers are added from a Map Image layer, they're not going to behave as expected when used in spatial operations. Is this the case?
As you can see in the image I attached to this question, I could not see "Render only when Filtered" option. The polygon layer is a FeatureLayer. And when I tried to open the polygon layer using ArcGIS online MapViewer it said "The layer 'POLYGON' is not accessible by ArcGIS Enterprise. Thus, editing will be disabled on this layer". Is that the reason I could not apply Spatial Query?
I would go to the web map your dashboard is referencing and try to re-add the polygon layer. If possible, add it from the service URL, "your-org/server/rest/services/Hosted/some-service/0".
Make sure to include the layer index number so you get just the layer you want, not the grouped list of services. I have had layers behave differently when added directly from the layer's URL.
I initially added the layer using the index number. Now, again I added a new duplicate layer of same using index and got same message on MapViewer and same behavior in Dashboard. We're using Version: 10.71
> I have two layers on my Dashboard App. One consists of polygons and other polylines with same map extent but have no common fields. I need to count the polylines present in the polygon when user clicks on one or polygon selection changed.
You would configure this in the Map element > Configure > Layer Actions. It looks like you're in the correct configuration dialog.
I just tested this capability and the spatial query between layers is working for me. What error or issue are you seeing?