This document discusses the structure of JSON filter objects used by the ArcGIS Data Reviewer Server REST API. This API supports 4 filter types: singleAttributeFilter, rangeAttributeFilter, listAttributeFilter, spatialFilter.
Filters are enclosed in curly ({}) braces and composed of key-value pairs. The key-value pairs depend upon the filter type. A colon separates keys and values. Commas separate key-value pairs.
The filtersArray is a JSON object that contains an array composed of filter objects. You can add one or more filters to this array.
When filtering results or reviewerResultsBy by attribute values, you can use field names from the Reviewer workspace's REVTABLEMAIN table.
This filter specifies a single value in a Dashboard result. singleAttributeFilter have two key-value pairs: fieldName and fieldValue. The fieldName key indicates the field to be filtered. The fieldValue key indicates the value to filter by.
You must enclose the fieldName value in quotes.
{singleAttributeFilter:[{fieldName:"<field>",fieldValue:<value>}]}
{singleAttributeFilter:[{fieldName:"severity",fieldValue:1}]}
This filter specifies a list of values in a Dashboard result. These filters have two key-value pairs: fieldName and fieldValue. The fieldName key indicates the field to be filtered. The fieldValue key indicates a list of values to filter by. The filter evaluates elements in the list using an OR operand: element 1 OR element 2 OR element 3.
You must enclose the fieldName value in quotes.
{listAttributeFilter:[{fieldName:"<field>",fieldValue:[<array of values>]}]}
{listAttributeFilter:[{fieldName:"subType",fieldValue:["Building","Tower"]}]}
This filter specifies a range of values in a Dashboard result. These filters have two key-value pairs: fieldName and fieldValue. The fieldName key indicates the value to be filtered. The fieldValue key indicates a range of values to filter by. The range's boundary values are included in the filter; using a range of 1 to 4 will filter by values 1-4 (not 2-3).
{filtersArray:[{rangeAttributeFilter:[{fieldName:"<field>",fieldValue:{minFieldValue:<value 1>,maxFieldValue:<value 2>}}]}]}
{filtersArray:[{rangeAttributeFilter:[{fieldName:"severity",fieldValue:{minFieldValue:1,maxFieldValue:3}}]}]}
This filter specifies a JSON polygon. The polygon defines a filter extent for a field. Features from REVTABLEPOINT, REVTABLELINE, and REVTABLEPOLY that intersect the filter polygon are included in the field operation. These features relate to summaries in REVTABLEMAIN by a join on LINKID to REVTABLEMAIN.RECORDID.
The polygon contains an array of rings
. Each ring is represented as an array of points. The first point of each ring is always the same as the last point.
Each point in the ring is represented as a 2-element array. The 0-index is the x-coordinate and the 1-index is the y-coordinate.
You must also assign a spatialReference
to the polygon. You specify this as a key-value pair.
{filtersArray:[{spatialFilter:[{"rings" : [ [ [<x11>, <y11>], [<x12>, <y12>], ..., [<x11>, <y11>] ], [ [<x21>, <y21>], [<x22>, <y22>], ..., [<x21>, <y21>] ]],"spatialReference" : {<spatialReference>}}}]}]}
{filtersArray:[{spatialFilter:[{"rings" : [ [ [-97.7325, 30.259],[97.7180,30.259 ], [-97.7180, 30.2687],[-97.7325, 30.2687],[-97.7325, 30.259] ]],"spatialReference" : {"wkid" : 4326}}]}]}
A filtersArray is a JSON object that contains an array of filters. This object has one key-value pair: the filtersArray key and an array of filters. Each filter is separated by a comma.
{filtersArray:[{<filter type>:[{fieldName:"<field type>",fieldValue:<value to filter by>}]}]}
{filtersArray:[{<filter type>:[{fieldName:"<field type>",fieldValue:<value to filter by>}]},{<filter type>:[{fieldName:"<field type>",fieldValue:<value to filter by>}]}]}
{filtersArray:[{singleAttributeFilter:[{fieldName:"severity",fieldValue:3}]}]}
{filtersArray:[{singleAttributeFilter:[{fieldName:"severity",fieldValue:2},{fieldName:"SubType",fieldValue:"Building"}]}]}
{filtersArray:[{singleAttributeFilter:[{fieldName:"severity",fieldValue:3}]},{listAttributeFilter:[{fieldName:"SubType",fieldValue:["Building","County Boundary"]}]}]}
{filtersArray:[{rangeAttributeFilter:[{fieldName:"severity",fieldValue:{minFieldValue:1,maxFieldValue:3}}]},{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}}]}]}