|
1 |
| -# Searching for Values in Attribute Fields |
| 1 | +# Sorting and Search Setup |
2 | 2 | [[toc]]
|
3 | 3 |
|
4 |
| -In <MobileAppName />, you can search for the content of fields in spatial layers and non-spatial tables, as well as searching values from multiple fields. |
| 4 | +There are some settings related to sorting, searching and browsing features in <MobileAppName /> that can be done in the QGIS project, such as define the order of features and values or include/exclude layers and fields from the search. |
| 5 | + |
| 6 | +Working with layers in the <MobileAppNameShort />, including browsing features and values, is described in [Layers in <MobileAppName />](../field/layers/). |
| 7 | + |
| 8 | + |
| 9 | +## Sorting features and value list |
| 10 | +The <MobileAppNameShort /> follows the sorting of features in the attribute table and of values in the value relation widget as set in the QGIS project. |
| 11 | + |
| 12 | +### Order value list by value |
| 13 | +The [Value relation](../layer/form-widgets/#value-relation) widget has the option *Order by value*. When checked, values in the drop-down list will be listed in alphabetical or numerical order. |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | +This setting is also followed by the <MobileAppNameShort />. |
| 18 | + |
| 19 | +On the left, you can see the default list of options in the drop-down menu. On the right, the option *Order by value* is used and observed by the <MobileAppNameShort />. |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +### Sorting features by field value |
| 24 | +By default, the <MobileAppNameShort /> orders features in a layer based on their `Feature ID`. The order of features can be defined in the Attribute table in QGIS. |
| 25 | + |
| 26 | +Simple sorting based on ascending or descending value of the attributes can be used: |
| 27 | + |
| 28 | +1. Open your project in QGIS |
| 29 | +2. Right-click on a survey layer and open the **Attribute table** |
| 30 | +3. In the **Attribute table**, click on the name of a field to sort the features according to the field values. |
| 31 | + Here, we use the `update_at` field to sort features by the last update. The feature that was updated last will be the first in the list. |
| 32 | +  |
| 33 | +4. Save and synchronise the project. |
| 34 | + |
| 35 | +In the <MobileAppNameShort />, features in a layer can be browsed by tapping the **Layers** button and selecting the layer from the list. |
| 36 | + |
| 37 | + |
| 38 | +Features in this layer are sorted by the same field value as was defined in the QGIS project. So, instead of the default sorting by the `Feature ID`, the features are ordered by the date and time of their last update. |
| 39 | + |
| 40 | + |
| 41 | +### Sorting features by expression |
| 42 | +Similarly, an expression can be used to sort features in the Attribute table and subsequently in the <MobileAppNameShort />. |
| 43 | + |
| 44 | +1. Open your project in QGIS |
| 45 | +2. Right-click on a survey layer and open the **Attribute table** |
| 46 | +3. Right-click on a field name that you want to use for sorting features and use the **Sort...** option |
| 47 | +  |
| 48 | +4. Enter the expression you want to use to sort this field. |
| 49 | + Here, we use `length( "notes" )` to sort features based on the length of the text in the `notes` field. |
| 50 | +  |
| 51 | +  |
| 52 | +5. Save and synchronise the project. |
| 53 | + |
| 54 | +When browsing features in the <MobileAppNameShort />, they will be sorted by the text length. |
| 55 | + |
| 56 | + |
5 | 57 |
|
6 | 58 | ## Setting identifiable layers in QGIS project
|
7 |
| -To be able to browse the attributes of a layer, it needs to be set as *Identifiable* in your <QGISHelp ver="3.22" link="user_manual/introduction/qgis_configuration.html?highlight=properties#data-sources-properties" text="QGIS project" />. |
| 59 | +To be able to browse the attributes of a layer, it needs be *Identifiable* in your <QGISHelp ver="latest" link="user_manual/introduction/qgis_configuration.html?highlight=properties#data-sources-properties" text="QGIS project" />. Layers are *identifiable* by default. |
| 60 | + |
| 61 | +If you define a layer as **not identifiable**, you won't be able to tap it in the <MobileAppNameShort /> or use the **Identify tool** in QGIS to see its attribute form. This may be useful for layers that are only used as background layers. |
8 | 62 |
|
9 | 63 | 1. Open your QGIS project
|
10 | 64 | 2. In the Menu > Project > Properties click on **Data Sources**
|
11 | 65 | 3. Check and uncheck layers in the **Identifiable** column to define which layers you want to be able to browse in your project.
|
12 | 66 |
|
13 | 67 | 
|
14 | 68 |
|
15 |
| -:::warning |
16 |
| -If you define a layer as **not identifiable**, you won't be able to tap it in <MobileAppName /> or use the **Identify tool** in QGIS to see its attribute form. |
17 |
| -::: |
18 | 69 |
|
19 | 70 | ## Exclude a field from the search
|
20 | 71 | By default, all attributes are searchable. You can exclude a field from the search in the **Layer properties**.
|
21 |
| -1. Navigate to the **Fields** tab |
22 |
| -2. Check the **Not searchable** option in the **Configuration** column |
23 |
| - |
24 | 72 |
|
25 |
| -:::warning |
26 | 73 | If a field is marked in a field configuration as **Not searchable**, it will be omitted from the search. There will be no search results, even if you search for a specific existing value of this field.
|
27 |
| -::: |
28 |
| - |
29 |
| -## Searching for values in Mergin Maps mobile app |
30 |
| -Attribute data can be browsed in <MobileAppName /> by tapping **Layers**. |
31 |
| - |
32 |
| -In the **Layers** window, choose a layer or a table from the list to open the attribute table. |
33 | 74 |
|
34 |
| - |
35 |
| - |
36 |
| -Here, you can browse the features. The search bar can be used to shortlist matching records. |
37 |
| - |
38 |
| -Tap on the record to zoom to the feature on the map and display its form. |
39 |
| - |
40 |
| - |
41 |
| - |
42 |
| -:::tip |
43 |
| -The search looks up for a match in all searchable attributes values and is not case sensitive. |
44 |
| -::: |
| 75 | +1. Navigate to the **Fields** tab |
| 76 | +2. Check the **Not searchable** option in the **Configuration** column |
| 77 | + |
45 | 78 |
|
0 commit comments