# Get List of all views in a perspective App

**URL:** <https://forum.inductiveautomation.com/t/get-list-of-all-views-in-a-perspective-app/54589>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 3, 2022, 2:08am UTC](https://forum.inductiveautomation.com/t/get-list-of-all-views-in-a-perspective-app/54589 "2022-01-03T02:08:48Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [January 3, 2022, 2:08am UTC](https://forum.inductiveautomation.com/t/get-list-of-all-views-in-a-perspective-app/54589/1 "2022-01-03T02:08:49Z")

</div>

Hello All,

Looking for a way to get a list of all views in a perspective application. Furthermore, can I specify a specific location to loop through the views. Like a folder of views within the project? Thanks in advance.

Frank

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [January 3, 2022, 3:58am UTC](https://forum.inductiveautomation.com/t/get-list-of-all-views-in-a-perspective-app/54589/2 "2022-01-03T03:58:51Z")

</div>

By conventional methods is not possible I think, I tried with “advanced methods” not success yet. I don’t know if it even possible or secure to do because the only scope who needs to know all available views is the designer.

---

<div class="post-metadata">

**Author:** ![deon.korb](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@deon.korb](https://forum.inductiveautomation.com/u/deon.korb)\
**Post date:** [January 3, 2022, 10:24am UTC](https://forum.inductiveautomation.com/t/get-list-of-all-views-in-a-perspective-app/54589/3 "2022-01-03T10:24:28Z")

</div>

You can use `system.perspective.getProjectInfo()`

[https://docs.inductiveautomation.com/display/DOC81/system.perspective.getProjectInfo](https://docs.inductiveautomation.com/display/DOC81/system.perspective.getProjectInfo)

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [January 3, 2022, 2:22pm UTC](https://forum.inductiveautomation.com/t/get-list-of-all-views-in-a-perspective-app/54589/4 "2022-01-03T14:22:01Z")

</div>

Ops

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [January 3, 2022, 2:31pm UTC](https://forum.inductiveautomation.com/t/get-list-of-all-views-in-a-perspective-app/54589/5 "2022-01-03T14:31:37Z")

</div>

Of course you can do that.  
Just download HMI framework resource from echange and there is script to show you how to do this. Even you can loop through objects inside view

The perspective code run in server side so you can get result only if run it in perspective scope or gateway

---

<div class="post-metadata">

**Author:** ![Mehrdad\_Telli](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mehrdad_telli/32/77763_2.png) [@Mehrdad\_Telli](https://forum.inductiveautomation.com/u/Mehrdad_Telli)\
**Post date:** [January 29, 2024, 6:22pm UTC](https://forum.inductiveautomation.com/t/get-list-of-all-views-in-a-perspective-app/54589/6 "2024-01-29T18:22:55Z")

</div>

Bind the following code to the 'props.items' **Tree** component and it will create a tree view of the entire project. It is also possible to add pages by changing the code. This simple code took a few hours to write. If you improve the code, please share it.

```auto
def transform(self, value, quality, timestamp):

	v = []
	for item in system.perspective.getProjectInfo()['views']:
		v.append(item['path'].split('/'))
	return returnViews(v)

def	items(label,items,data):

		return {
			      "label": label,
			      "expanded": True,
			      "data" : data,
			      "items": items,
			    }

def returnViews(viewsArray):

	chieldItem = []
	pastItem = ''
	idx2 = 0
	v1 = []
	firstMulti = True
	lastFolder = False
	pastFolderName = ''
	viewsArraySize = 0
	chieldItemLast = []
	itemLast = 0
	
	idx = 0
	for idx, item in enumerate( viewsArray):
					
		if len(viewsArray[idx])==idx2+1:
			v1.append(items(viewsArray[idx][idx2+0],[],'1'))
			
		if len(viewsArray[idx])>idx2+1:
		  	if (pastItem != viewsArray[idx][idx2+0]) and len(chieldItem)>0:
		  		chieldItem.append([''])	
				v1.append(items(pastItem,returnViews(chieldItem),'2'))
				chieldItem= []
				pastItem = viewsArray[idx][idx2+0]
				
			viewsArraySub1Column = list(viewsArray[idx])
			del viewsArraySub1Column[0]
			chieldItem.append((viewsArraySub1Column))	
			
				
	  	if (pastItem != viewsArray[idx][idx2+0]) and chieldItem != []:
	  		if firstMulti == False:
	  			chieldItem.append([''])	
				v1.append(items(pastItem,returnViews(chieldItem),'3'))
				chieldItem=[]
				firstMulti = True
			else:
	  			firstMulti = False

		pastItem = viewsArray[idx][idx2+0]
		idx = idx + 1
	return (v1)

```

 ![Screenshot (13)](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/7/a75825b43c9d52742d1580f6f486073749000593.png)

---

<div class="post-metadata">

**Author:** ![leigh.taylor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leigh.taylor/32/39298_2.png) [@leigh.taylor](https://forum.inductiveautomation.com/u/leigh.taylor)\
**Post date:** [April 15, 2025, 12:57pm UTC](https://forum.inductiveautomation.com/t/get-list-of-all-views-in-a-perspective-app/54589/7 "2025-04-15T12:57:51Z")

</div>

Is it possible to get Custom Properties contained within a view via a gateway script?  
We have embedded in each view a Custom Property for Configuration Management.  
I want a view in the runtime that shows this info. for all views in the system.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/1/116a6f1da3b8903984bbfb21e2d39222aba476df.png)

As a separate Table view, like this

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/d/8d4a276fad963c6fa96810e362e1d30997e2dbd0.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 15, 2025, 1:04pm UTC](https://forum.inductiveautomation.com/t/get-list-of-all-views-in-a-perspective-app/54589/8 "2025-04-15T13:04:05Z")

</div>

There is no such thing. You would have to implement message handlers to push that information to a central data structure (probably a top-level object in a library script).

---

<div class="post-metadata">

**Author:** ![leigh.taylor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leigh.taylor/32/39298_2.png) [@leigh.taylor](https://forum.inductiveautomation.com/u/leigh.taylor)\
**Post date:** [April 15, 2025, 1:09pm UTC](https://forum.inductiveautomation.com/t/get-list-of-all-views-in-a-perspective-app/54589/9 "2025-04-15T13:09:08Z")

</div>

I haven't read much about 8.3 is something coming that will enable view level Config management, Versioning at a minimum?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 15, 2025, 1:11pm UTC](https://forum.inductiveautomation.com/t/get-list-of-all-views-in-a-perspective-app/54589/10 "2025-04-15T13:11:41Z")

</div>

Perspective already stores all of its views in git-friendly format on your gateway. (I can't answer most questions about v8.3, but it is known to be even more git-friendly.)

I presumed you were wanting to track some kind of runtime dynamic configuration. That wouldn't be versioned anywhere.

Why do you need this? (It seems to me you haven't made sufficiently generic parameterized views that can cover many uses.)

---

<div class="post-metadata">

**Author:** ![leigh.taylor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leigh.taylor/32/39298_2.png) [@leigh.taylor](https://forum.inductiveautomation.com/u/leigh.taylor)\
**Post date:** [April 15, 2025, 1:16pm UTC](https://forum.inductiveautomation.com/t/get-list-of-all-views-in-a-perspective-app/54589/11 "2025-04-15T13:16:10Z")

</div>

Yes Git is great and we are able to use that to do version control, however we wanted to be able to show which version of what view you are running in a gateway.

Also for a "Normal" user of the system they dont want to go into Git to check if they are running the latest version of a view.

Just seem missing to me not to be able to have simple version info on a view.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 15, 2025, 1:18pm UTC](https://forum.inductiveautomation.com/t/get-list-of-all-views-in-a-perspective-app/54589/12 "2025-04-15T13:18:16Z")

</div>

Perspective scripts run in the gateway, and can call external processes. There's nothing preventing you from have views extract and display their own git revision history and branch meta-data.
