Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value relation dropdown does not autofill #5566

Open
cruelaid opened this issue Aug 16, 2024 · 3 comments
Open

Value relation dropdown does not autofill #5566

cruelaid opened this issue Aug 16, 2024 · 3 comments

Comments

@cruelaid
Copy link

Describe the issue

During feature creation in QGIS, value relation widgets will automatically populate with a value that satisfies the filter expression. This autofill works even when the default value expression is left blank. This functionality is not preserved in QField, which will only autofill a value when a default value is specified.

Reproduction steps

Steps to reproduce the behavior:

  1. Setup a value relation widget from a populated table in QGIS
  2. Add a feature, then check if the value relation field has a value
  3. Repeat the previous step in QField

Expected behavior

Both QField and QGIS should autofill the value relation field with the same appropriate value

Observed behavior

QGIS autofills the field, but QField leaves it NULL.

Desktop (please complete the following information)

  • OS: Windows
  • QGIS Version 3.38.0
  • QFieldSync Version 4.10.1

Mobile (please complete the following information)

  • Device: Samsung Galaxy A13
  • OS: Android 14
  • QField version: 3.3.10 (4bd923)

Additional information

  • Problem started happening recently, didn't happen in an older version of QField: No
  • Problem can be reliably reproduced, doesn't happen randomly: Yes
  • Problem happens with all files and projects, not only some files or projects: Unknown
@nirvn
Copy link
Member

nirvn commented Aug 16, 2024

@cruelaid , a small sample project would help.

@cruelaid
Copy link
Author

demo.zip
Here you go!

@nirvn nirvn removed the feedback label Aug 24, 2024
@she-weeds
Copy link

It seems to boil down to QGIS and QField having inconsistent default behaviour. In QGIS you need to set 'Allow NULL value' to emulate the same behaviour as QField, i.e., not pre-populating with the first entry in the list of values. But it's harder to do it vice versa (have QField auto populate the first value in the drop down list).

Personally I prefer QField's default behaviour (default value is NULL unless specified in default value expression, or repeating from previous feature), as it's better for data validation in the field, and think QGIS should change instead, but given how long it's been this way in QGIS it might not be practical...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants