mobile icon indicating copy to clipboard operation
mobile copied to clipboard

Relation Reference filtering on Attribute Form does not work in Mergin Input

Open leorudczenko opened this issue 2 years ago • 1 comments

Summary

We are working with a relational database structure within a GeoPackage and we are trying to create an Attribute Form for a geometry layer. One of the fields is a Relation Reference to another table which is a dictionary of values. In our real example, the list of values in this dictionary will be over 2000, which means it is not ideal if a user needs to scroll through them all. Therefore, we are trying to apply a filter to this drop down, based on a second attribute of the dictionary table. This filter works fine in QGIS, but does not appear in Mergin Input.

To Reproduce

We found that this can be replicated in a minimal way using the following steps:

  • Create a new project in QGIS using the MerginMaps plugin option New basic QGIS project
  • Modify the Survey_points.gpkg by adding a new field to the Survey_points table
    • This new field must be a foreign key to a new child table
    • The new child table must have a primary key field and 2 additional text fields (in this example, name and type)
  • Modify the Survey_points attribute form with the new Relation Reference field to filter the values by one of the additional columns from the child table as below (in this case, it is filtered by type): image
  • Sync the project in QGIS
  • Sync the project in Mergin Input
  • At this point, you can view the attribute form in Mergin Input and see that the filtering is not applied to the Relation Reference attribute

Expected Result

The attribute form within Mergin Input should feature an additional drop down menu to reduce the selection options using the filter applied in QGIS, similar to what is seen in QGIS here where there are 2 drop down menus: image

Instead, there is only 1 basic drop down menu in the attribute form within Mergin Input which shows all of the values: image image

Example Project

You can see this issue in this public Mergin project.

Software Versions

  • QGIS 3.34.0 for Windows
  • Mergin Maps QGIS Plugin 2023.4.1
  • Mergin Maps mobile Input 2.5.0 for Android

leorudczenko avatar Jan 10 '24 14:01 leorudczenko

As an alternative to the drop-down filtering, a responsive text-box that filtered records (as it does in QGIS), would also be very helpful.

volcan01010 avatar Mar 18 '24 10:03 volcan01010