---
title: "How to set 3 levels of hierarchy in the Schema ?"
url: "https://openforis.support/questions/2164/how-to-set-3-levels-of-hierarchy-in-the-schema"
tags: ["collect"]
status: "answered"
score: 0
answer_count: 2
asked: "2019-03-01T11:42:45"
last_activity: "2019-03-11T10:04:12"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# How to set 3 levels of hierarchy in the Schema ?

Asked by Chatmetaleux on 2019-03-01

As in post http://www.openforis.org/support/questions/497/collect-survey-designer-parent-code
I would like to link 3 levels of plots (parcelle,carré,quadrat ; then trees) with 3 neested 'Code Attribute'. Those levels are well defined in the sampling_desgin (level_1 -> level_3).

    level1_code	level2_code	level3_code	x	y	srs_id	province	region	plot_id 
    1	1	1	100	1800	EPSG:32630			1_1_1
    1	1	2	100	1800	EPSG:32630			1_1_2 
    1	1	3	100	1800	EPSG:32630			1_1_3
    1	1	4	100	1820	EPSG:32630			1_1_4

I can set the level_2 for 'carré' with his parent 'parcelle'.
But I can't set the level_3 for 'quadrat' as the "Select parent attribute" popup only shows the level_1 'parcelle', not the level_2.

![alt text][1]



![alt text][2]

How can I set this level_3 ?

Btw I can specify (I tested that works) the geofence of a tree with the coordinates x,y with the formula : `idm:samplingPointCoordinate(parent()/parc_id,parent()/carre_id,parent()/quadrat_id)`

  [1]: https://i.ibb.co/WkyTftC/of-level3-quadrat.png
  [2]: https://i.ibb.co/y6dVLL3/of-level2-carre.png


## Answer (score 0, by Chatmetaleux on 2019-03-01)

Link: https://openforis.support/questions/2164/how-to-set-3-levels-of-hierarchy-in-the-schema/2165

Sorry the images are cut...
![alt text][1]

![alt text][2]


  [1]: https://i.imgur.com/uPT32Gx.png
  [2]: https://imgur.com/yqQ4sJ4.png


## Answer (score 0, by Chatmetaleux on 2019-03-11)

Link: https://openforis.support/questions/2164/how-to-set-3-levels-of-hierarchy-in-the-schema/2182

Thanks to developpers, the templates are fixed now in the new version of Collect.
