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?
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.
Open up the Layer Properties menu and go to Attributes Form.
Select the field you're interested in.
Under Widget Type, select Unique Values.
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.
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?