You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a filter expression on a value relations widget, the app will add all values that meet the filter expression when only one value is selected in the drop-down menu while filling out the form. This can be reproduced in the example project support/form_setup.
To reproduce the issue:
Have a survey layer with a Value Relation widget and set a filter expression based on the value of another field:
The expected behaviour, which is reproduced in QGIS, is that when selecting a plant type in the form, you will be able to select a plant of that type in the form. In this case, 'Vegetable' was selected as the plant type and 'Carrot' as the plant species:
When filling out the form in the app, all of the species are saved to the field in the form. See video below:
Screen_Recording_20240514_164208.mp4
The text was updated successfully, but these errors were encountered:
This weird behavior is actually caused by the project not being set up properly:
While the value relation for field type is properly set:
Key column is Code, -> stores values [A, B, C ...]
Value column is Description, -> displays values [Fruit, Vegetable, Flower ...]
The value relation for sub-type is wrong:
filter expression is OK, only shows entries where Code matches the type's selected Key.
Value column is Species, -> displays values [Carrot, apple ...]
❌ Key column is Class, -> stores values [A, B, C ...] which do not correspond to a single Value entry
Setting the Key column to either fid or Species solves it, as there is now a 1-1 connection to the Value values.
So the question is: what should be displayed when the selected Key corresponds to multiple Values, and should we somehow warn users about it?
QGIS handles it by displaying the first matching value.
I believe our approach is more correct, we display a concatenated string of all corresponding values.
When using a filter expression on a value relations widget, the app will add all values that meet the filter expression when only one value is selected in the drop-down menu while filling out the form. This can be reproduced in the example project support/form_setup.
To reproduce the issue:
Screen_Recording_20240514_164208.mp4
The text was updated successfully, but these errors were encountered: