# Perspective Tree

**URL:** <https://forum.inductiveautomation.com/t/perspective-tree/38504>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [September 9, 2020, 1:33am UTC](https://forum.inductiveautomation.com/t/perspective-tree/38504 "2020-09-09T01:33:55Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![pawel.kondol1](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@pawel.kondol1](https://forum.inductiveautomation.com/u/pawel.kondol1)\
**Post date:** [April 25, 2022, 5:06pm UTC](https://forum.inductiveautomation.com/t/perspective-tree/38504/21 "2022-04-25T17:06:08Z")

</div>

Hi All,

I stuck with the same component. I’m done level 1 but have problem with level 2.

My table:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/7/770390ef6f6d361fa61b96f58964f38133467e14.png)

```auto
	
	Level_1 = []
	items = []
	for job in value:
	    if job['id'] not in Level_1:
	        item = {
	            "label":{
	            "text": job['Level_1']},
	            "expanded": True,
	            "data": "",
	            "items": [
	                {
	                    "label": {
	                    "text": job['Level_2']},
	                    "expanded": False,
	                    ###############################################
	                    "data": {
	                        "jobID": job['id'],
	                        "Level_2": job['Level_2']
	                    },
	                    ###############################################
	                    "items": []
	                }
	            ]
	        }
	        Level_1.append(job['id_Level_2'])
	        items.append(item)
	    else:
	        for index, customer in enumerate(Level_1):
	            if customer == job['id_Level_2']:
	                itemIndex = index
	
	        item = {
	            "label": {
	            "text" : job['Level_2']
	            },
	            "expanded": False,
	            ###############################################
	            "data": {
	                "jobID": job['id'],
	                "Level_2": job['Level_2']
	            },
	            ###############################################
	            "items": []
	        }
	        items[itemIndex]['items'].append(item)
	
	
	return items

```

Results:  
I can see all 4 from Level\_1, but then Level\_2 is not linked to Level\_1.  
I can see:  
Defect - \> Missing Lub  
Materials → Screw cross treaded  
Maintenance → 2E23458G01  
Quality → 3E45658G02

I like to see:  
Defects → Missing Lub  
 → Screw cross treaded  
Materials → 2E23458G01  
 → 3E45658G02  
Maintenance - \> Empty  
Quality → Empty

Best regards  
Pawel

[Previous page](https://forum.inductiveautomation.com/t/perspective-tree/38504.md?page=1)
