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 relation widget for the secondary. I used the expression : "Primary Code"= current_value('Primary')
It should be able to limit the choices you can choose when editing the attribute table.
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.