Overview
The filters
is a JSON
object that contains an array composed of filter objects. You can add one or more filters to this array.
Filters are enclosed in curly ({}) braces and are composed of key-value pairs. The key-value pairs depend upon the filter type. A colon separates keys and values, while commas separate key-value pairs.
When filtering results or reviewer
by attribute values, you can use field names from the Data Reviewer workspace's REVTABLEMAIN table.
This API supports four filter types:
- singleAttributeFilter
- listAttributeFilter
- rangeAttributeFilter
- spatialFilter
singleAttributeFilter
This filter specifies a single value in a Dashboard result. single
has two key-value pairs: field
and field
. The field
key indicates the field to be filtered. The field
key indicates the value to filter by.
JSON Syntax
{singleAttributeFilter:[{fieldName:"<field>",fieldValue:<value>}]}
JSON Example
{singleAttributeFilter:[{fieldName:"severity",fieldValue:1}]}
listAttributeFilter
This filter specifies a list of values in a Dashboard result. list
has two key-value pairs: field
and field
. The field
key indicates the field to be filtered. The field
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.
JSON Syntax
{listAttributeFilter:[{fieldName:"<field>",fieldValue:[<array of values>]}]}
JSON Example
{listAttributeFilter:[{fieldName:"subType",fieldValue:["Building","Tower"]}]}
rangeAttributeFilter
This filter specifies a range of values in a Dashboard result. range
has two key-value pairs: field
and field
. The field
key indicates the value to be filtered. The field
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).
JSON Syntax
{filtersArray:[{rangeAttributeFilter:[{fieldName:"<field>",fieldValue:{minFieldValue:<value 1>,maxFieldValue:<value 2>}}]}]}
JSON Example
{filtersArray:[{rangeAttributeFilter:[{fieldName:"severity",fieldValue:{minFieldValue:1,maxFieldValue:3}}]}]}
spatialFilter
The spatial
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 spatial
to the polygon. You specify this as a key-value pair.
JSON Syntax
{filtersArray:[{spatialFilter:[{"rings" : [ [ [<x11>, <y11>], [<x12>, <y12>], ..., [<x11>, <y11>] ], [ [<x21>, <y21>], [<x22>, <y22>], ..., [<x21>, <y21>] ]],"spatialReference" : {<spatialReference>}}}]}]}
JSON Example
{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}}]}]}
filtersArray
A filtersArray is a JSON object that contains an array of filters. This object has one key-value pair: the filters
key and an array of filters. Each filter is separated by a comma.
JSON Syntax
{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>}]}]}
JSON Example
{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}}]}]}