QGIS Autofill of data attribute field not working

attribute-tableqgis

I would like to have the autofill when filling my data attribute table field. The autofill like you have in some HTML form, etc.
Basically If, for instance, I type the letter I, the autofill should show me some recently used words starting with this letter.

enter image description here

Like you see above, I have a record called INFERRED DUCT, which I have to copy every time.

How about if I could just type the letter I and the tool would autofill it for me?

I tried also to define the formula in the Attributes Form -> Defaults section, where I put the following formula:

    CASE WHEN "PLANT_ITEM" = 'I' THEN 'INFERRED DUCT'

but it didn't work despite no error message shown in the output preview.

Is there any way to make the auto population in the Data attribute table, as known from i.e HTML forms?

Best Answer

Go to Layer Properties -> Attribute Form and select the field you want autocomplete activated. Set the widget type to unique values (check the box "Editable"). This should do what you asked for!

enter image description here

To save those edits to the Attribute Form (and anything else like styling, rednering options etc) you can export them - in the bottom of the "Layer Properties" window you find the button "Style". There you can save the layer style file as .qml - you can load an exisiting layer style file the same way!

Related Question