18

I want to show a drop down list in the feature attributes dialog.

I have three different building zones. The hot Wohnzon A, B residential zone and residential zone C. Now I have an attribute called the "Zonenart". Now I track a new zone. And instead of the attribute "Zonenart" write something purely by hand, I want to be able to select it directly. How can I achieve this?

Taras
  • 32,823
  • 4
  • 66
  • 137
user8839
  • 603
  • 2
  • 8
  • 16

2 Answers2

27

Open the layer properties dialog and select the fields tab, click the button in the Edit Widgets column for the field and select Value Map

enter image description here

which will then give you this when using the info tool

enter image description here

Nathan W
  • 34,706
  • 5
  • 97
  • 148
13

For QGIS 3:

Right mouse click over the layer, and then proceed with Layer Properties > Attributes Form > Fields > [field name].

Under "Widget Type", choose "Value Map" in the drop down.

Widget Type

Taras
  • 32,823
  • 4
  • 66
  • 137
jane
  • 320
  • 2
  • 6
  • Is it possible to create such a value map also on a database level, and not just a project level, so no matter in what QGIS project the user would edit the layer, he would get this dropdown with possible values (like domains in ArcGIS), based on a "value map" table stored in a database ? – juraj murcko Oct 12 '22 at 14:26
  • Is it possible to pick a value from the list to be the default rather than a blank value being displayed. I know we can set the defaults but then you need to click on the box to activate it. – GeorgeC Feb 19 '24 at 21:22