4

I want to collect data on crop species affected by diseases using QField. I want to create a widget so that I can have a dropdown list of the different crop species. In theory, if I were to export this project onto QField and collect data, I would select the crop species from the drop down list. Most of the answers I've found suggest changing the widget type to relation reference and link it to a CSV, but my data is already in the attribute table. Has anyone done this before? Which widget type should I use? Or any tutorials?

  • I don't have much experience with QField, but one of the widgets in QGIS is Unique Values, which gives users a dropdown list of all values already used in the field. Does that work? – JoshC May 8 at 15:50
  • Thank you. Yes unique value works perfectly. I followed this tutorial. youtube.com/watch?v=pZYe23bVKrs – Cherri May 10 at 10:43
2

With your layer already loaded into the QGIS TOC (the layer that contains all the possible values), you should go to properties > attributes form > Widget type and select a «Value Map type». Then, click on Load Data from Layer button and on the upcoming window, you should select the layer as well as the column where to get the possible values from.

Then, via the QField Sync plugin, you can export the project to QField, so the designed form will be also available from your mobile device. Hope this helps.

1

Hy, the manual (https://qfield.org/docs/project-management/vector-layers.html#field-widget) tell us the what widgets are suported. Have you tried Value Map?

1
  1. Open up the Layer Properties menu and go to Attributes Form.

  2. Select the field you're interested in.

  3. Under Widget Type, select Unique Values.

widget selection

It's important to note that this widget type will only allow the selection of values already present in the field. If you need to add new values, you'll need to edit the attribute table directly.

You can also check the Editable box to allow entry of new values, but you lose the dropdown box.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.