I added a Value Relation Widget in the Attributes Form of a shapefile in order to generate a drop-down menu that is supposed to make fieldwork more efficient. The idea is to have an optional filter that limits the options in this drop-down.
More specifically, I have a first drop-down in which I can select plant families. When a plant family is selected, I want to limit the options in the second drop-down (Genus) to the genera that are part of this plant family.
I have very limited experience with SQL, so this might be complete nonsense. But the following filter expression appears to work in QGIS desktop:
"Family" = current_value( 'Family' ) OR current_value( 'Family' ) IS NULL
When no Family is set, all the options for Genus are available. When I select a Family, the options in Genus are limited to genera that are part of this family.
Now comes the problem: When I export the project to QField, the filter no longer works. In QField, I can select any Genus at any time (independent of the Family that I have or have not selected previously); moreover it appears that selecting a Genus can even reset the Family value.
Here some screenshots of desktop and mobile version of the project. In both cases I selected Aquifoliaceae as the Family which should limit the Genus options to Ilex in this example. On the mobile device, the options were not limited and selecting Acacia, for example, did reset the Family to NULL. Subsequently, I selected the Family again, with no effect on the Genus.
Is there a way to solve this issue?
Edit: I changed some plant family entries and exported the project again. Now the selection of a Family limits the Genus options, but the Genus doesn't limit the Epithet options. So basically, the problem moved to another level. I'm not sure what causes that issue but I suspect it is a bug in QField?