diff --git a/src/field/filtering/index.md b/src/field/filtering/index.md index 5707ddc4..bfae4569 100644 --- a/src/field/filtering/index.md +++ b/src/field/filtering/index.md @@ -1,13 +1,20 @@ --- description: Add custom filters to sort and display only those features that you need during your field survey. +outline: deep --- # Filtering Features in Mergin Maps Mobile App [[toc]] -Custom filters can be added to the to easily filter features displayed on the map as well as in the [survey layers](../layers/#browsing-features). +Custom filters can be added to the to easily filter features displayed on the map and in the [survey layers](../layers/#browsing-features). -::: tip Feature filtering blog +![Filtering features in Mergin Maps mobile app](./mobile-filtering.gif "Filtering features in Mergin Maps mobile app") + +::: tip Example project available +You can explore filtering by cloning our public project +::: + +::: warning Feature filtering blog You can read about this feature also on our blog . ::: @@ -18,10 +25,10 @@ Filters can be enabled and defined in QGIS in **Project Properties** for GeoPack If you do not see the **Filtering** option in the **Project properties**, check for [plugin upgrades](../../setup/install-mergin-maps-plugin-for-qgis/#plugin-upgrade). ::: -Check the :heavy_check_mark: **Enable filtering** option in the tab, click on the **Add filter** button and select a filter type from the list. The list of available [filter types](#filter-types) and their properties can be found below. +Check the :heavy_check_mark: **Enable filtering** option in the tab, click on the **Add filter** button and select a filter type from the list. Then, define the filter: - - **Type** - the filter type (in general, it should match the widget type of the filtered field) + - **Type** - choose the filter type (see [Filter types](#filter-types) for more details). - **Layer** - choose from the project's GeoPackage layers - **Field** - choose from the fields of the layer. Only fields with data types compatible with the selected filter type are offered. - **Title** - the name of the filter, which will be displayed in the @@ -35,27 +42,10 @@ The order of filters can be changed by selecting a filter and using the **Up** a Don't forget to save your project and synchronise changes so that you can use the filters in the . - -### Filter types - -**Text** filter uses simple text input. Results are filtered based on the SQL expression `"field" ILIKE '%input%'`. Available for text and number field types. - -**Number** filter provides *from* and *to* number inputs. Results are filtered based on SQL expression `"field" >= 'input_from' AND "field" <= 'input_to'`. Available for text and number field types. - -**Date** filter provides *from* and *to* date (calendar) inputs. Results are filtered based on SQL expression `"field" >= 'input_from' AND "field" <= 'input_to'`. Available for date field types configured with the [Date and time widget](../../layer/date-time/). - -**Boolean** filter provides a toggle between *all*, *true* and *false* values. Results are filtered based on SQL expression `"field" == 'input'`. Available for Boolean, text and integer field types configured with the [Checkbox widget](../../layer/checkbox/). - -**Single select** filter provides a drop-down menu of field values. One value can be selected at once. The results are filtered based on SQL expression `"field" == 'input'`. Available for all field types. Note that Value relations with *multiple selections* are currently **not** supported. - -**Multi select** filter provides a drop-down menu of field values. Multiple values can be selected at once. The results are filtered based on SQL expression `"field" IN ('input')`. Available for all field types. Note that Value relations with *multiple selections* are currently **not** supported. - -In the , the filters look like this: - -![Filter types in Mergin Maps mobile app](./mobile-filter-types.webp "Filter types in Mergin Maps mobile app") - ## Filtering features in the mobile app -Filters defined in [ project in QGIS](#enable-and-define-filtering-in-qgis) can be used in the . You can filter features across multiple layers by entering or selecting values in corresponding filters. The filtering affects both the map display and the feature browsing list. +Filters defined in [ project in QGIS](#enable-and-define-filtering-in-qgis) can be used in the . + +You can filter features across multiple layers as well as use multiple filters on one layer. The filtering affects both the map display and the feature browsing list. Filters do not stay saved when the app is restarted. @@ -77,3 +67,72 @@ Here is an example of how filtering works: You can use the active **Filters** button to quickly access filters. ![Active filter in Mergin Maps mobile app](./mobile-filtered-features.webp "Active filter in Mergin Maps mobile app") + +## Filter types +Here is an overview of available filter types. + +In QGIS, you choose from the following filter types: [Text](#text), [Number](#number), [Date](#date), [Checkbox](#checkbox), [Single select](#single-select), [Multi select](#multi-select). + +![QGIS filter types](./qgis-filter-types.webp "QGIS filter types") + +In the , the respective filters look like this: +![Mergin Maps mobile app filters](./mobile-filters.webp "Mergin Maps mobile app filters") + +### Text + +The text filter can be used to find all features where the selected field contains the entered text. + +Type in a word, a part of the word or a number into the filter and **Apply filters** to see the results. + +Available for text and number field types. + +![Mergin Maps mobile app Text filter](./mobile-filter-text.webp "Mergin Maps mobile app Text filter") + +This filter uses the same logic as the SQL expression `"field" ILIKE '%input%'`. + +### Number +The number filter provides *from* and *to* number inputs. + +Available for text and number field types. + +![Mergin Maps mobile app Number filter](./mobile-filter-number.webp "Mergin Maps mobile app Number filter") + +This filter uses the same logic as the SQL expression `"field" >= 'input_from' AND "field" <= 'input_to'`. + +### Date +The date filter provides *from* and *to* date calendar inputs. + +Available for date field types configured with the [Date and time widget](../../layer/date-time/). + +![Mergin Maps mobile app Date filter](./mobile-filter-date.webp "Mergin Maps mobile app Date filter") + +This filter uses the same logic as the SQL expression `"field" >= 'input_from' AND "field" <= 'input_to'`. + +### Checkbox +The checkbox filter provides a toggle between *all*, *true* and *false* values. Available for Boolean, text and integer field types configured with the [Checkbox widget](../../layer/checkbox/). + +![Mergin Maps mobile app Checkbox filter](./mobile-filter-checkbox.webp "Mergin Maps mobile app Checkbox filter") + +This filter uses the same logic as the SQL expression `"field" == 'input'`. + +### Single select +The single select filter provides a drop-down menu of field values. One value can be selected at once. + +Available for all field types. For text, number, date and Boolean field types generates a list of used values. + +![Mergin Maps mobile app Single select filter](./mobile-filter-single-select.webp "Mergin Maps mobile app Single select filter") + +This filter uses the same logic as the SQL expression `"field" == 'input'`. + +Note that Value relations with *multiple selections* are currently **not** supported. + +### Multi select +The multi select filter provides a drop-down menu of field values. Multiple values can be selected at once. + +Available for all field types. For text, number, date and Boolean field types generates a list of used values. + +![Mergin Maps mobile app Multi select filter](./mobile-filter-multi-select.webp "Mergin Maps mobile app Multi select filter") + +This filter uses the same logic as the SQL expression `"field" IN ('input')`. + +Note that Value relations with *multiple selections* are currently **not** supported. diff --git a/src/field/filtering/mobile-filter-checkbox.webp b/src/field/filtering/mobile-filter-checkbox.webp new file mode 100644 index 00000000..d5f7b4dc Binary files /dev/null and b/src/field/filtering/mobile-filter-checkbox.webp differ diff --git a/src/field/filtering/mobile-filter-checkbox.xcf b/src/field/filtering/mobile-filter-checkbox.xcf new file mode 100644 index 00000000..37b7fc11 Binary files /dev/null and b/src/field/filtering/mobile-filter-checkbox.xcf differ diff --git a/src/field/filtering/mobile-filter-date.webp b/src/field/filtering/mobile-filter-date.webp new file mode 100644 index 00000000..ad198545 Binary files /dev/null and b/src/field/filtering/mobile-filter-date.webp differ diff --git a/src/field/filtering/mobile-filter-date.xcf b/src/field/filtering/mobile-filter-date.xcf new file mode 100644 index 00000000..53cf7baa Binary files /dev/null and b/src/field/filtering/mobile-filter-date.xcf differ diff --git a/src/field/filtering/mobile-filter-multi-select.webp b/src/field/filtering/mobile-filter-multi-select.webp new file mode 100644 index 00000000..dd7dde95 Binary files /dev/null and b/src/field/filtering/mobile-filter-multi-select.webp differ diff --git a/src/field/filtering/mobile-filter-multi-select.xcf b/src/field/filtering/mobile-filter-multi-select.xcf new file mode 100644 index 00000000..eccf652e Binary files /dev/null and b/src/field/filtering/mobile-filter-multi-select.xcf differ diff --git a/src/field/filtering/mobile-filter-number.webp b/src/field/filtering/mobile-filter-number.webp new file mode 100644 index 00000000..b745b2ca Binary files /dev/null and b/src/field/filtering/mobile-filter-number.webp differ diff --git a/src/field/filtering/mobile-filter-number.xcf b/src/field/filtering/mobile-filter-number.xcf new file mode 100644 index 00000000..b7ce3577 Binary files /dev/null and b/src/field/filtering/mobile-filter-number.xcf differ diff --git a/src/field/filtering/mobile-filter-single-select.webp b/src/field/filtering/mobile-filter-single-select.webp new file mode 100644 index 00000000..b173e0d6 Binary files /dev/null and b/src/field/filtering/mobile-filter-single-select.webp differ diff --git a/src/field/filtering/mobile-filter-single-select.xcf b/src/field/filtering/mobile-filter-single-select.xcf new file mode 100644 index 00000000..9f9722ad Binary files /dev/null and b/src/field/filtering/mobile-filter-single-select.xcf differ diff --git a/src/field/filtering/mobile-filter-text.webp b/src/field/filtering/mobile-filter-text.webp new file mode 100644 index 00000000..45f196f4 Binary files /dev/null and b/src/field/filtering/mobile-filter-text.webp differ diff --git a/src/field/filtering/mobile-filter-text.xcf b/src/field/filtering/mobile-filter-text.xcf new file mode 100644 index 00000000..eecf2b61 Binary files /dev/null and b/src/field/filtering/mobile-filter-text.xcf differ diff --git a/src/field/filtering/mobile-filter-types.webp b/src/field/filtering/mobile-filter-types.webp deleted file mode 100644 index 526b73a5..00000000 Binary files a/src/field/filtering/mobile-filter-types.webp and /dev/null differ diff --git a/src/field/filtering/mobile-filter-types.xcf b/src/field/filtering/mobile-filter-types.xcf deleted file mode 100644 index 90358f22..00000000 Binary files a/src/field/filtering/mobile-filter-types.xcf and /dev/null differ diff --git a/src/field/filtering/mobile-filtering.gif b/src/field/filtering/mobile-filtering.gif index f0401448..5fa0b5ea 100644 Binary files a/src/field/filtering/mobile-filtering.gif and b/src/field/filtering/mobile-filtering.gif differ diff --git a/src/field/filtering/mobile-filters.webp b/src/field/filtering/mobile-filters.webp new file mode 100644 index 00000000..3a4bf220 Binary files /dev/null and b/src/field/filtering/mobile-filters.webp differ diff --git a/src/field/filtering/mobile-filters.xcf b/src/field/filtering/mobile-filters.xcf new file mode 100644 index 00000000..b9f3058b Binary files /dev/null and b/src/field/filtering/mobile-filters.xcf differ diff --git a/src/field/filtering/qgis-filter-types.webp b/src/field/filtering/qgis-filter-types.webp new file mode 100644 index 00000000..b6a27aa7 Binary files /dev/null and b/src/field/filtering/qgis-filter-types.webp differ diff --git a/src/field/filtering/qgis-filter-types.xcf b/src/field/filtering/qgis-filter-types.xcf new file mode 100644 index 00000000..35790422 Binary files /dev/null and b/src/field/filtering/qgis-filter-types.xcf differ