Filter

Description

LicenseLicense:

The ArcGIS Data Reviewer for Server extension is required in order to use this resource.

Use the Filter operation to limit, or more precisely, specify aggregations returned by a Dashboard request. Filters are expressions that apply conditions to a query. These conditions can be spatial or attribute-based.

Filters apply to fields in the reviewerResultsBy Dashboard collection. Filters are similar to a SQL WHERE clause in that you apply a condition to a query. For example, you can create a filters that have the following conditions:

You can filter reviewerResultsBy by fields, excluding REVCHECKRUNTABLE.CHECKRUNPROPERTIES, from the Reviewer workspace's REVTABLEMAIN and REVCHECKRUNTABLE tables.

Request parameters

Parameter

Details

filtersArray

Description: An array of filters. A filter is a JSON structure. There are four types: singleAttributeFilter, rangeAttributeFilter, listAttributeFilter, spatialFilter. You can have one or more filters of different types in the filters array. If you use multiple filters, spatialFilters are applied before attribute filters. Multiple filters are evaluated using AND operands: Filter 1 AND Filter 2 AND Filter 3.

JSON Structures:

filters

f

Description: The response format. The default response format is html.

Values: html | json

Example usage

Example 1: Filter reviewerResultsBy dashboard results to show total counts where SEVERITY values = 1.

http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/Dashboard/reviewerResultsBy/SEVERITY/filter?filtersArray={filtersArray:[{singleAttributeFilter:[{fieldName:"severity",fieldValue:1}]}]}&f=json

JSON response example

{
 "fieldName": "SEVERITY",
 "dashboardResults": [
  
 ],
 "filters": [
  {
   "singleAttributeFilter": [
    {
     "fieldName": "severity",
     "fieldValue": 1
    }
   ]
  }
 ]
}

Example 2: Filter reviewerResultsBy dashboard results to show total counts for FEATUREOBJECTCLASS equal to 'OpenWaterA.'

http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/Dashboard/reviewerResultsBy/FEATUREOBJECTCLASS/filter?filtersArray={filtersArray:[{singleAttributeFilter:[{fieldName:"FeatureObjectClass",fieldValue:"OpenWaterA"}]}]}&f=json

JSON response example

{
 "fieldName": "FEATUREOBJECTCLASS",
 "dashboardResults": [
  
 ],
 "filters": [
  {
   "singleAttributeFilter": [
    {
     "fieldName": "FeatureObjectClass",
     "fieldValue": "OpenWaterA"
    }
   ]
  }
 ]
}

Example 3: Filter reviewerResultsBy dashboard results to show total counts for the Cemetery SUBTYPE. http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/Dashboard/reviewerResultsBy/SUBTYPE/filter?filtersArray={filtersArray:[{singleAttributeFilter:[{fieldName:"SubType",fieldValue:"Cemetery"}]}]}&f=pjson

JSON response example

{
 "fieldName": "SUBTYPE",
 "dashboardResults": [
  
 ],
 "filters": [
  {
   "singleAttributeFilter": [
    {
     "fieldName": "SubType",
     "fieldValue": "Cemetery"
    }
   ]
  }
 ]
}

Example 4: Filter reviewerResultsBy dashboard results to show total counts of BATCHJOBCHECKGROUPs that have a severity of 4. This example demonstrates filtering one result value type, BATCHJOBCHECKGROUP, by another (SEVERITY).

http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/Dashboard/reviewerResultsBy/BATCHJOBCHECKGROUP/filter?filtersArray={filtersArray:[{singleAttributeFilter:[{fieldName:"severity",fieldValue:4}]}]}&f=json

JSON response example

{
 "fieldName": "BATCHJOBCHECKGROUP",
 "dashboardResults": [
  
 ],
 "filters": [
  {
   "singleAttributeFilter": [
    {
     "fieldName": "severity",
     "fieldValue": 4
    }
   ]
  }
 ]
}

Example 5: Use a listAttributeFilter to filter SEVERITY values by building and tower subtypes. This example shows filtering one results value type, SEVERITY, by another (SUBTYPE).

http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/Dashboard/reviewerResultsBy/SEVERITY/filter?filtersArray={filtersArray:[{listAttributeFilter:[{fieldName:"subType",fieldValue:["Building","Tower"]}]}]}&f=json

JSON response example

{
 "fieldName": "SEVERITY",
 "dashboardResults": [
  {
   "fieldValue": "2",
   "count": 268
  }
 ],
 "filters": [
  {
   "listAttributeFilter": [
    {
     "fieldName": "subType",
     "fieldValue": [
      "Building",
      "Tower"
     ]
    }
   ]
  }
 ]
}

Example 6: Use a rangeAttributeFilter to filter FEATUREOBJECTCLASS by severity 1-3. This example shows filtering one result value type, FEATUREOBJECTCLASS, by another (SEVERITY).

http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/Dashboard/reviewerResultsBy/FEATUREOBJECTCLASS/filter?filtersArray={filtersArray:[{rangeAttributeFilter:[{fieldName:"severity",fieldValue:{minFieldValue:1,maxFieldValue:3}}]}]}&f=json

JSON response example

{
 "fieldName": "FEATUREOBJECTCLASS",
 "dashboardResults": [
  {
   "fieldValue": "BuiltupA",
   "count": 266
  },
  {
   "fieldValue": "BuiltupP",
   "count": 2
  }
 ],
 "filters": [
  {
   "rangeAttributeFilter": [
    {
     "fieldName": "severity",
     "fieldValue": {
      "minFieldValue": 1,
      "maxFieldValue": 3
     }
    }
   ]
  }
 ]
}

Example 7: Use a spatialFilter to find SUBTYPE Reviewer results within a JSON polygon.

http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/Dashboard/reviewerResultsBy/SUBTYPE/filter?filtersArray={filtersArray:[{spatialFilter:[{"rings":[[[-97.7300477260853,30.297977761151],[-97.6975021395297,30.297977761151],[-97.6975021395297,30.2593722255952],[-97.7300477260853,30.2593722255952],[-97.7300477260853,30.297977761151]]],"spatialReference":{"wkid":4326}}]}]}&f=json

JSON response example

{
 "fieldName": "SUBTYPE",
 "dashboardResults": [
  {
   "fieldValue": "Building",
   "count": 42
  },
  {
   "fieldValue": "Cemetery",
   "count": 1
  },
  {
   "fieldValue": "County",
   "count": 1
  },
  {
   "fieldValue": "County Boundary",
   "count": 10
  },
  {
   "fieldValue": "Gate",
   "count": 1
  },
  {
   "fieldValue": "Lake/Pond",
   "count": 2
  },
  {
   "fieldValue": "Minor Civil Division",
   "count": 3
  },
  {
   "fieldValue": "Mobile Home Park",
   "count": 7
  },
  {
   "fieldValue": "Nation",
   "count": 1
  },
  {
   "fieldValue": "Park Boundary",
   "count": 2
  },
  {
   "fieldValue": "PopulatedPlace",
   "count": 2
  },
  {
   "fieldValue": "Tower",
   "count": 1
  }
 ],
 "filters": [
  {
   "spatialFilter": 
   {
     "rings": [[
         [-97.7300477260853,30.297977761151],[-97.6975021395297,30.297977761151],
         [-97.6975021395297,30.2593722255952],[-97.7300477260853,30.2593722255952],
         [-97.7300477260853,30.297977761151]
     ]],
     "spatialReference": {"wkid": 4326}
    }
  }
 ]
}

Example 8: Use multiple filters in the filters array to return total counts of Building Subtypes with a severity of 5 or 2.

http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/Dashboard/reviewerResultsBy/SUBTYPE/filter?filtersArray={filtersArray:[{singleAttributeFilter:[{fieldName:"SubType",fieldValue:"Building"}]},{listAttributeFilter:[{fieldName:"severity","fieldValue":[5,2]}]}]}&f=json

JSON response example

{
 "fieldName": "SUBTYPE",
 "dashboardResults": [
  {
   "fieldValue": "Building",
   "count": 266
  }
 ],
 "filters": [
  {
   "singleAttributeFilter": [
    {
     "fieldName": "SubType",
     "fieldValue": "Building"
    }
   ]
  },
  {
   "listAttributeFilter": [
    {
     "fieldName": "severity",
     "fieldValue": [
      5,
      2
     ]
    }
   ]
  }
 ]
}

Example 9: Use multiple filters to limit dashboard results to FEATUREOBJECTCLASS with a severity between 1 and 3 and Building SUBTYPE.

http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/Dashboard/reviewerResultsBy/FEATUREOBJECTCLASS/filter?filtersArray={filtersArray:[{rangeAttributeFilter:[{fieldName:"severity",fieldValue:{minFieldValue:1,maxFieldValue:3}}]},{singleAttributeFilter:[{fieldName:"subType",fieldValue:"Building"}]}]}&f=json

JSON response example

{
 "fieldName": "FEATUREOBJECTCLASS",
 "dashboardResults": [
  {
   "fieldValue": "BuildingA",
   "count": 40
  }  
 ],
 "filters": [
  {
   "rangeAttributeFilter": [
    {
     "fieldName": "severity",
     "fieldValue": {
      "minFieldValue": 1,
      "maxFieldValue": 3
     }
    }
   ]
  },
  {
   "singleAttributeFilter": [
    {
     "fieldName": "subType",
     "fieldValue": "Building"
    }
   ]
  }
 ]
}

Example 10: Use multiple filters to limit dashboard results to FEATUREOBJECTCLASS with a severity between 1 and 3 and PopulatedPlace and Mobile Home Park SUBTYPE .

http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/Dashboard/reviewerResultsBy/FEATUREOBJECTCLASS/filter?filtersArray={filtersArray:[{rangeAttributeFilter:[{fieldName:"severity",fieldValue:{minFieldValue:1,maxFieldValue:3}}]},{listAttributeFilter:[{fieldName:"subType",fieldValue:["PopulatedPlace","Mobile Home Park"]}]}]}&f=json

JSON response example

{
 "fieldName": "FEATUREOBJECTCLASS",
 "dashboardResults": [
  {
   "fieldValue": "BuildingA",
   "count": 40
  }  
 ],
 "filters": [
  {
   "rangeAttributeFilter": [
    {
     "fieldName": "severity",
     "fieldValue": {
      "minFieldValue": 1,
      "maxFieldValue": 3
     }
    }
   ]
  },
  {
   "singleAttributeFilter": [
    {
     "fieldName": "subType",
     "fieldValue": "Building"
    }
   ]
  }
 ]
}

Example 11: Filter reviewerResultsBy by REVIEWERCODE, a field in the REVTABLEMAIN. REVIEWERCODE is not included in the list of fields displayed by a dashboard resource.

http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/Dashboard/reviewerResultsBy/FEATUREOBJECTCLASS/filter?filtersArray={filtersArray:[{singleAttributeFilter:[{fieldName:"REVIEWERCODE",fieldValue:3}]}]}&f=pjson

JSON response example

{
 "fieldName": "FEATUREOBJECTCLASS",
 "dashboardResults": [
  {
   "fieldValue": "BuiltupP",
   "count": 2
  }
 ],
 "filters": [
  {
   "singleAttributeFilter": [
    {
     "fieldName": "REVIEWERCODE",
     "fieldValue": 3
    }
   ]
  }
 ]
}

Example 12: Filter reviewerResultsBy (BATCHJOBCHECKGROUP) by CHECKNAME, a field in the REVCHECKRUNTABLE. CHECKNAME is not included in the list of fields displayed by a dashboard resource.

localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/Dashboard/reviewerResultsBy/BATCHJOBCHECKGROUP/filter?filtersArray={filtersArray:[{singleAttributeFilter:[{fieldName:"CHECKNAME",fieldValue:"Unique ID Check"}]}]}&f=pjson

JSON response example

{
  "fieldName": "BATCHJOBCHECKGROUP",
  "dashboardResults": [{
    "fieldValue": "Attribution (Storm Sewer)",
    "count": 23
  }, {
    "fieldValue": "Attribution (Stormwater)",
    "count": 532
  }, {
    "fieldValue": "Attribution (Water Distribution)",
    "count": 75
  }],
  "filters": [{
    "singleAttributeFilter": [{
      "fieldName": "CHECKNAME",
      "fieldValue": "Unique ID Check"
    }]
  }]
}

Example 13: Filter reviewerResultsBy (Severity) by Review lifecycle phase.

http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/Dashboard/reviewerResultsBy/SEVERITY/filter?filtersArray=%7BfiltersArray%3A%5B%7BsingleAttributeFilter%3A%5B%7BfieldName%3A%22lifecyclephase%22%2CfieldValue%3A2%7D%5D%7D%5D%7D&f=pjson

JSON response example

{
 "fieldName": "SEVERITY",
 "dashboardResults": [
  {
   "fieldValue": "1",
   "count": 189
  },
  {
   "fieldValue": "3",
   "count": 200
  },
  {
   "fieldValue": "4",
   "count": 160
  }
 ],
 "filters": [
  {
   "singleAttributeFilter": [
    {
     "fieldName": "lifecyclephase",
     "fieldValue": 2
    }
   ]
  }
 ]
}

3/3/2017