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):
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.
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:
New basic QGIS project
Survey_points.gpkg
by adding a new field to theSurvey_points
tablename
andtype
)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 bytype
):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
3.34.0
for Windows2023.4.1
2.5.0
for Android