Is it possible to create a multiple select dropdown list/select widget in QGIS which links to a separate txt file?
I want to collect species lists for different locations in QField but do not want to have to enter hundreds of species names manually.
I am using QGIS 2.18
Best Answer
First I recommend to use QGIS 3.4.2, because QGIS 2.18.26 did not provide the desired results.
If your species data are saved in a CSV file, load the data into the QGIS as a table from Add vector layer NOT from Add delimited text layer along with the vector layer that you want to populate its field with the species information as follows:
Text
to populate it with information from the CSV file'Layer properties of the vector layer -> Fields
, and change theEdit widget
fromText Edit
toValue Relation
Under Select Layer, Key Column, Value Column, select the CSv file that contains the species information, use ID column as Key Column, and Species Name as Value Column as shown below, and click OK.
Now Go to to the attribute Table of the vector layer -> Species Column -> You will see a drop down list coming from the CSV file in which you can choose the species names.
Here is the output: