Número de ID del error |
BUG-000164286 |
Enviado | January 11, 2024 |
Última modificación | May 27, 2025 |
Relacionado con | ArcGIS Online |
Versión encontrada | Oct 2023 |
Sistema operativo | N/A |
Versión de sistema operativo | N/A |
Estado | As Designed
Tras revisión realizada por el equipo de desarrollo, se ha determinado que este comportamiento es acorde con lo designado. Consulte los detalles en la sección Información adicional.
|
Información adicional
This is a known behavior regarding the execution order of filters in feature services. When both viewDefinitionQuery and topFilter are applied to a feature service, the system processes the topFilter first, followed by the viewDefinitionQuery.
To achieve simultaneous execution of both filtering operations, the correct approach is to structure the query using sqlExpression within the viewLayerDefinition instead of using viewDefinitionQuery directly.
The recommended structure is:
json{
"viewDefinitionQuery": "",
"viewLayerDefinition": {
"filter": {
"sqlExpression": "status = 'Active'"
},
"topFilter": {
"orderByFields": "CreationDate DESC",
"groupByFields": "Name",
"topCount": 1
}
}
}
This structure ensures that both the SQL expression filter and the top filter are processed together, providing more precise control over the returned data and preventing unexpected results that may occur when filters are applied in sequence.
Solución alternativa
For query purposes, it is recommended to not add the topFilter parameter on the view definition. Use the queryTopFeatures method to get the correct result.
Pasos para reproducir