Filtering downloaded data

Under the Models node of the Mobile configuration, each model can have a child Sync node that is used to filter the data that is downloaded to the local device. For example, the Sync node for the AssetManagement_Asset model filters asset records, and the Sync node for the Property_Address model filters addresses.

The filters are defined in Item nodes, which are children of the Download > Items node under the Sync node.

Note: When you add the Sync node to a model, the Download and Items nodes are automatically added as well.

An Item node can use either of two properties to define a filter for the parent model: DataFilter and AdditionalQueryParameters.

Data filters

Each DataFilter attribute specifies a property of the parent model, an operator, and the value to filter on. For example, this filter will return only addresses that are located on Main Street:

[{Property:StreetName,Operator:Equal,Value:Main}]

You can also define complex filters based on more than one property. When you define a complex filter you must specify a logical operator such as And or Or in addition to the filter criteria. For example, this filter will return addresses that are located on either Main Street or Elm Street:

[{operator:Or,criteria:[{Property:StreetName,Operator:Equal,Value:Main},{Property:StreetName,Operator:Equal,Value:Elm}]}]

Additional query parameters

The AdditionalQueryParameters attribute can be used to filter asset types. Enter a key/value pair to specify the asset types that you want to include. For the value, you can specify more than one asset type in a comma-separated list. For example, this parameter will return sewer mains and water mains:

Type=SewerMain, WaterMain