Relation Reference filtering on Attribute Form does not work in Mergin Input
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.gpkgby adding a new field to theSurvey_pointstable- 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,
nameandtype)
- Modify the
Survey_pointsattribute 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 bytype): - 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:
Instead, there is only 1 basic drop down menu in the attribute form within Mergin Input which shows all of the values:
Example Project
You can see this issue in this public Mergin project.
Software Versions
- QGIS
3.34.0for Windows - Mergin Maps QGIS Plugin
2023.4.1 - Mergin Maps mobile Input
2.5.0for Android
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.