Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Overview

Download parameters are a useful way to limit the feature service data that are downloaded to MobileMap. This can be helpful on large projects where downloading all data (spatial and tabular features) in all layers may cause a performance problem, produce a cluttered map, or simply result in the download of unnecessary or irrelevant data downloads.

...

Use of download parameters can also be helpful when you want to restrict data download to only the data that is relevant to specific users. An example of this is when an auditor needs to download all the data that was collected by a particular cruiser, but does not want to download any data from other cruisers. Another example is where a team wants to download all of the data for a particular project (or client, region, cover type, etc.) rather than all of the data in the feature service.

Setting Download Parameters

To specify download parameters, open the Edit Download Parameters tool (Actions>Edit Download Parameters). You will see a table with a row for each of the layers in the service(s) that have been selected and initialized. The checkbox indicates that data should be downloaded for that layer. If data should be filtered or limited when downloading, specify the ‘Where Clause’. The Where Clause is the logic that will be used by MobileMap when it requests data for download. It follows the syntax used by the ArcGIS REST API’s where clause (https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm#GUID-62EE7495-8688-4BD0-B433-89F7E4476673).

...

Text values need to be surrounded in single quotes. Note that on many android devices there are two single quote characters on the software keyboard. One that is vertical and another that is rotated. Use the vertical one, not the rotated one.

...

Download Parameters Logic

When a download parameters are set, they replace the default where clause of 1=1 (always true, thus all relevant records are downloaded). To avoid redundant data downloads, however, MobileMap also applies a filter on the last modified date for each record. This ensures that MobileMap only downloads those records that have been created or updated since the last MobileMap download from this device. For example, if MobileMap downloaded data at noon yesterday and there is a download parameter of Region='NW', MobileMap will query the server using the following logic: select all features that were created or edited after noon yesterday and where the value of the Region field is 'NW'.

Changing Download Parameters

If you decide to change download parameters AFTER data have been downloaded to your device, it is important to understand how MobileMap will request data from the service. If a download parameter of Region='NW' is used to download data yesterday at noon, then is changed to Region='SW', MobileMap will query the server using the following logic: select all features that were created or edited after noon yesterday and where the value of the Region field is 'SW'. This will NOT download data prior to noon yesterday where the value of the Region field is 'SW'. If you want to get ALL data where where the value of the Region field is 'SW', it is necessary to reset the last download date. To do this, press the RESET button on the Edit Download Parameters tool. While this approach will work, a user will now have some data where the value of the Region field is 'NW' and some data where the value of the Region field is 'SW'. Subsequent downloads will only download data where the value of the Region field is 'SW'. This can create confusion, because some data are up-to-date (SW) while others are not (NW). Therefore, the typical and recommended approach to changing download parameters is to complete the following steps:

  1. Upload all data from your device to ensure that no data are lost in step 3 below

  2. Change your download parameters to the new desired parameters

  3. Re-initialize your database

  4. Download data

  5. Verify that you recieved the data you expect based on your download parameters. If you need to adjust, repeat steps 2-4 above

Common Where Clauses

Where Clause

Description

Example

field_name='text_value'

Downloads data where the text value matches the value in single quotes within the specified field

Region='NW'

field_name=numeric_value

Downloads data where the numeric value matches the specified value within the specified field

Site_Index=2

field_name='text_value' AND field_name=numeric_value

Combination of the two examples above using the ‘AND’ operator. This will only download data where both conditions are met for a single feature

Region='NW' AND Cruiser_ID='ABC'

field_name='text_value' OR field_name=numeric_value

Similar to above but using ‘OR’. This will download any feature that meets either criteria

Cruiser_ID='ABC' OR Contractor_ID='XYZ'

field_name IN ('text_value1','text_value2')

Allows for selection of multiple values within a list. Similar to using the OR operator on a single field.

Status IN ('Cruised','Checked')

  • known issue - this is not working and will be addressed in a future release. In the meantime, use OR as described above

...