# Is root iterable?

**URL:** <https://forum.inductiveautomation.com/t/is-root-iterable/73031>\
**Category:** Ignition\
**Tags:** perspective, vision, scripting, ignition80\
**Created:** [April 28, 2023, 3:45pm UTC](https://forum.inductiveautomation.com/t/is-root-iterable/73031 "2023-04-28T15:45:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roberto\_Luis](https://avatars.discourse-cdn.com/v4/letter/r/977dab/32.png) [@Roberto\_Luis](https://forum.inductiveautomation.com/u/Roberto_Luis)\
**Post date:** [April 28, 2023, 3:45pm UTC](https://forum.inductiveautomation.com/t/is-root-iterable/73031/1 "2023-04-28T15:45:46Z")

</div>

Hi everyone, I'm trying to implement a feature that needs to go through view's items and with each item, I need to go through its props.

Initially, I thoguht I could be able to handle it with a OnStartUp Event, and use a script for it, using something like:

```auto
	aux_list = []
	for item in view:
		try:
			aux_list.append(item['props']['params']['tag'])
			  #Here I'm trying to access the item's props/params/tag
 		except:
			pass
	#After that, I would be able to send this aux_list to what I want to do.

```

Is it possible? I found some solutions for Vision, but idk how to proceed in Perspective with it.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 28, 2023, 3:48pm UTC](https://forum.inductiveautomation.com/t/is-root-iterable/73031/2 "2023-04-28T15:48:06Z")

</div>

This may be helpful

> [@Iterate through all components programatically in Perspective?](https://forum.inductiveautomation.com/t/iterate-through-all-components-programatically-in-perspective/32938):
>
> I was wondering if there's a way to iterate through all components on screen for a perspective view? I was trying to use getRootContainer and getChildren but it doesn't seem as straight forward as I thought/as it was for Vision. Any know how this is done?

---

<div class="post-metadata">

**Author:** ![Roberto\_Luis](https://avatars.discourse-cdn.com/v4/letter/r/977dab/32.png) [@Roberto\_Luis](https://forum.inductiveautomation.com/u/Roberto_Luis)\
**Post date:** [May 3, 2023, 5:08pm UTC](https://forum.inductiveautomation.com/t/is-root-iterable/73031/3 "2023-05-03T17:08:32Z")

</div>

Very helpful, but I didn't find a way to access the items of another view, just using the self.view.rootContainer.children, but I want to pass the view path and go through its items instead, not just the self view.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 3, 2023, 5:18pm UTC](https://forum.inductiveautomation.com/t/is-root-iterable/73031/4 "2023-05-03T17:18:03Z")

</div>

You would have to obtain a reference to the actual view instance. There's no exposed way to do that for any arbitrary view path. From a live _session_ object, you have a `getPages()` method, and each Page has a `getViews()` method.

---

<div class="post-metadata">

**Author:** ![Roberto\_Luis](https://avatars.discourse-cdn.com/v4/letter/r/977dab/32.png) [@Roberto\_Luis](https://forum.inductiveautomation.com/u/Roberto_Luis)\
**Post date:** [June 9, 2023, 12:22pm UTC](https://forum.inductiveautomation.com/t/is-root-iterable/73031/5 "2023-06-09T12:22:00Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/a/ba36a6e8722ddd6c445ad249d84e1649493637ca.png)

Now I want to create a dropdown list, and its options would be a list of all views on SubSystems.

I know I could just put manually as a parameter on MainView, but this functionality of going throught the views would optmize the maintence and future upgrades.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [June 9, 2023, 12:32pm UTC](https://forum.inductiveautomation.com/t/is-root-iterable/73031/6 "2023-06-09T12:32:23Z")

</div>

Was there a question in there? 🙂

---

<div class="post-metadata">

**Author:** ![Roberto\_Luis](https://avatars.discourse-cdn.com/v4/letter/r/977dab/32.png) [@Roberto\_Luis](https://forum.inductiveautomation.com/u/Roberto_Luis)\
**Post date:** [June 9, 2023, 12:41pm UTC](https://forum.inductiveautomation.com/t/is-root-iterable/73031/7 "2023-06-09T12:41:08Z")

</div>

Of course, I want to see if its possible to make a list of views as we have in Vision with **system.gui.getWindowNames()**

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [June 9, 2023, 12:46pm UTC](https://forum.inductiveautomation.com/t/is-root-iterable/73031/8 "2023-06-09T12:46:47Z")

</div>

Yes, I thought it was already discussed above.  
[https://docs.inductiveautomation.com/display/DOC81/system.perspective.getProjectInfo](https://docs.inductiveautomation.com/display/DOC81/system.perspective.getProjectInfo)

One of the keys is `views`.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 11, 2023, 7:00am UTC](https://forum.inductiveautomation.com/t/is-root-iterable/73031/9 "2023-06-11T07:00:37Z")

</div>

> [@Roberto\_Luis](#):
>
> I know I could just put manually as a parameter on MainView, but this functionality of going throught the views would optmize the maintence and future upgrades.

I'd argue that simple manually configured options/buttons make maintenance/upgrades easier than complicated scripts.They don't require as much documentation or knowledge of scripting functions.
