1

I have the following layer table

Prim  | Secondary      |Tertiary

Apple | Apple Pen      | Apple Pen White
Apple | Apple Pen      | Apple Pen Red
Apple | Apple Phone    | Apple Phone Black
Apple | Apple Phone    | Apple Phone Silver

Banana| Banana Bread   | Banana Bread Chocolate
Banana| Banana Smoothie| Banana Smoothie Sugar
Banana| Banana Yoghurt | Banana Yoghurt Smooth
Banana| Banana Yoghurt | Banana Yoghurt Fruit

Car   | Car Toyota     | Car Toyota Yaris
Car   | Car Toyota     | Car Toyota Corolla
Car   | Car Ford       | Car Ford Figo

I was able to use value relations and a value map to create a drop-down for 2 levels.

I used a value map for the Primary QGIS Screenshot

I used a value relation widget for the secondary. I used the expression : "Primary Code"= current_value('Primary')

QGIS Screenshot However, I am struggling to get the third level.

It should be able to limit the choices you can choose when editing the attribute table.

eg.

If I choose Apple in the Primary column then in the second column, I should only be able to select Pen or Phone, if I chose Pen then in the Tertiary column, I should only be able to select White and red and Black or silver if I chose Phone.

1

Just do a value relation with the expression:

"Primary Code"= current_value('Primary') AND "Secondary Code"= current_value('Secondary')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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