QGIS – Guide to Creating Permanent Dropdown Lists in Attribute Table

attribute-tabledropdownlistfields-attributesqgis

I've had some success at creating the drop down lists for attributes in QGIS 3.16 using the Attribute Form option in Layer Properties, as shown here: Creating a multiple select dropdown list in QGIS?

My problem is that whenever I remove the layer and then bring it back into QGIS, my drop down lists are not an option in the attributes. They have gone.

Could anyone give guidance to how to make drop down lists permanent, so when I export a shapefile or bring it back into QGIS, the drop down lists remain?

Best Answer

You will have to save the style for this layer and load it when you will load your shapefile back to your QGIS project.

  • To save the style: right click on the Layer -> Export -> Save as QGIS Layer Style File
  • Import style saved in previous step: Layer properties -> Symbology -> Layer styling -> Style -> Load Style

Or alternatively

  • Save layer as geopackage. Then you can save style inside geopackage and use that style as a default. Layer properties -> Symbology -> Layer styling -> Style -> Save as default -> Datasource Database

Just make sure that when saving a style, you also check the Forms option. It is checked by default.

Save Layer Style

Related Question