Fields with free text and options/suggestions

I would like to have a form with some fields where there are predefined sugestions to the value combined with free text. Is this possible? Can some one help me how to achieve this.

Hello! There are a couple of options:

  • The most simple approach I can think of is to either use the “Remember last value” functionality, or set up a “Default value” for each attribute/field. Both are explained on the documentation.
    • With “Remember last value”, you can autocomplete with the last used value and modify it. On QField, you can enable and disable this function on each individual field whenever you want.
    • With “Default value” you can just simply input a static text, or you can go pretty complex using expressions to set rules that autocomplete the text field. In any case, it will just autocomplete, as long as you don’t hide the field from the form, you can go ahead and edit it before saving the changes.
  • If you want to have a list of multiple suggestions for each field, you can make use of an autocomplete feature of QField when setting the field with a “Value Relation” form; check this video tutorial to see an example of how you can set it up. When it’s all ready, QField will give you both a search icon that lists all the options configured for that field, or you can just start typing and QField will try to autocomplete a suggestion based on your current text. This works by having a list (defined with a table, or from some attribute from any layer) and configuring QGIS/QField to store and show to you all the values contained in that list.
  • If you want to have a field which its’ completed text has some parts repeated/predictable and some parts undefined (you can’t just make a list with all the options because they aren’t previously known) you can for example make complex relations that take new values you’ve input and add them to the autocomplete list. But my suggestion would be to keep it simple and split that field into two, one that only contains the part that’s on the autocomplete list, and another that just lets you write whatever you want.
    For example, if you want to store an address, instead of having a single “Address” field and writing “123 Something Street”, you can have “Address_street” with a list of all the streets in the city (which would help avoid misspellings, typos, etc), and another called “Address_number” that can even be of type number instead of simply text.
  • Alternatively to the “Value Relation” form, you can use the “Value Map” option. It’s pretty similar, although simpler. You can check this other video tutorial from the same person to check it out.