I cannot understand what the Value Relation widget of the Fields menu in QGIS actually does.

For example: I have a point layer with some columns (ID, value1...) and a table (so just a dbf file) with other values (ID, valueA,...). If I open the Fields menu of the point layer I can set some options for the selected column: Layer (set to table.dbf), Key column (set to ID) and Value column (set to valueA).

Now, if I create a new point, it appears in the row of the widget column a dropdown menu where I can choose the valueA of the table.dbf. And that's ok.

But, what is the meaning of the Key column?

Does someone have an explanation for that? Am I missing something?

1 Answer 1


Key column is a value, that is saved to the field and replaces previous value. The idea is that each key corresponds to value, that you see in the drop-down menu.

EDIT: Imagine a simple table:

Key | Value
1   | Apple
2   | Pear
3   | Passion fruit

Value relation enables you to select "apple" in a drop-down, but save value "1" (the key) to the field. As you can imagine, this can be very useful in relation DBs, such as PostgreSQL.

  • thanks for your reply... but I still don't get it.. have you an example to share?
    – matteo
    Commented Jul 30, 2014 at 14:19
  • I added an example - hopefully it's more clear now. Commented Jul 30, 2014 at 14:59
  • Is there an example of how to setup the widget in a custom form? Been looking for an example to setup my form.
    – MrKingsley
    Commented Sep 12, 2016 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.