# Script Console Browse for Tag Providers

**URL:** <https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [November 12, 2021, 9:47am UTC](https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011 "2021-11-12T09:47:38Z")\
**Posts on this page:** 14\
**Page:** 1

<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:** [November 12, 2021, 9:47am UTC](https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011/1 "2021-11-12T09:47:38Z")

</div>

HI,

I use the following code to browse for a list of tag providers:

```auto
def getProviders():
	providers = system.tag.browse('')
	targetProviders = []
	for provider in providers.getResults():
		targetProviders.append(provider['name'])
	
	return targetProviders

```

This works when tag change script or a Perspective session calls this, but doesn’t when called from the script console.

I need to use this for some tag maintenance where I browse the gateway and search for some issues.

Any reason why it doesn’t work from the designer script console context and is there an alternative way of getting a list of all providers?

Regards,  
Deon

---

<div class="post-metadata">

**Author:** ![m.pelagatti](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/m.pelagatti/32/68595_2.png) [@m.pelagatti](https://forum.inductiveautomation.com/u/m.pelagatti)\
**Post date:** [November 12, 2021, 10:13am UTC](https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011/2 "2021-11-12T10:13:01Z")

</div>

Hi,  
i use this code inside a button… i don’t know if useful for you

```auto
context = event.source.getAppContext()

provs = []
tm = context.getTagManager()
provprops = tm.getProviderProperties()
for p in provprops:
	provs.append(p.getName())
 
print provs

```

---

<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:** [December 19, 2021, 3:49am UTC](https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011/3 "2021-12-19T03:49:27Z")

</div>

Hi

Do you know how to get provs list in perspective session?  
There is no event.source.getAppContext in perspective

---

<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:** [December 19, 2021, 1:03pm UTC](https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011/4 "2021-12-19T13:03:04Z")

</div>

It was quicker to make a list by hand.

My automated tag maintenance scripts run on tag change events, so there the blank browse technique still works.

I’m interested in the solution, though.

---

<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:** [December 19, 2021, 2:29pm UTC](https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011/5 "2021-12-19T14:29:13Z")

</div>

Perspective scripts run in the gateway, so you’d need the `GatewayContext` (aka `IgnitionGateway`) instead of the `VisionClientContext` you get from a component. The rest would be the same.

---

<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:** [December 20, 2021, 11:26am UTC](https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011/6 "2021-12-20T11:26:27Z")

</div>

> [@pturmel](#):
>
> `GatewayContext`

Thanks Phil

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [October 12, 2023, 3:42am UTC](https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011/7 "2023-10-12T03:42:38Z")

</div>

What about from the Designer's Script Console? How would I get a DesignerContext object reference?

Using the GatewayContext as an example, this doesn't work for the DesignerContext:

```auto
from com.inductiveautomation.ignition.designer.model import DesignerContext
context = DesignerContext.get()

```

I've also always been confused how I would know about the "get" method of the GatewayContext object, as this isn't in the javadocs?

---

<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:** [October 12, 2023, 3:59am UTC](https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011/8 "2023-10-12T03:59:41Z")

</div>

The get method is on IgnitionGateway, a deliberately undocumented internal "implementation" class. The static getter on it is a big code-purity no-no, but mostly okay for our environment.

If you're using Ignition Extensions, there's a system.util.context getter already. The generic equivalent of IgnitionGateway in the designer is the IgnitionDesigner (or something like that) class, which has a static getFrame method that returns the instance.

Note that relying on any of these is at least a code smell to be aware, since theoretically any of these methods could go away on any Ignition upgrade.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [October 12, 2023, 4:04am UTC](https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011/9 "2023-10-12T04:04:23Z")

</div>

Cool, i forgot about the system.util.context function, cheers. This is purely for dev stuff, like summarising tags per provider, so if it breaks it only inconveniences me

---

<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:** [October 12, 2023, 12:14pm UTC](https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011/10 "2023-10-12T12:14:36Z")

</div>

I also added `system.util.toolkitCtx()` to my Integration Toolkit module to get the module context (which a wrapped gateway, designer, or vision client context).

---

<div class="post-metadata">

**Author:** ![John\_S1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@John\_S1](https://forum.inductiveautomation.com/u/John_S1)\
**Post date:** [December 29, 2023, 11:28am UTC](https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011/11 "2023-12-29T11:28:04Z")

</div>

Hi, Are you able to fetch the tag provider details in perspective, I'm also having a similar kind of requirement, Does anyone find any scripts for the same?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [January 3, 2024, 7:17am UTC](https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011/12 "2024-01-03T07:17:41Z")

</div>

What details are you looking for?

You should be able to use this (which is further up this topic) to see what other properties you can read

> [@Script Console Browse for Tag Providers](https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011/2):
>
> Hi, i use this code inside a button… i don’t know if useful for you context = event.source.getAppContext() provs = [] tm = context.getTagManager() provprops = tm.getProviderProperties() for p in provprops: provs.append(p.getName()) print provs

---

<div class="post-metadata">

**Author:** ![Prahil\_S\_Kumar1](https://avatars.discourse-cdn.com/v4/letter/p/dfb087/32.png) [@Prahil\_S\_Kumar1](https://forum.inductiveautomation.com/u/Prahil_S_Kumar1)\
**Post date:** [January 10, 2024, 5:16am UTC](https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011/13 "2024-01-10T05:16:55Z")

</div>

If you are searching for getting the tag providers list for perspective, to find the default tag provider for the project, then may be u can try this.

```auto
config = system.tag.getConfiguration()
for row in config:
	prov = str(row['path'])
	print row

```

---

<div class="post-metadata">

**Author:** ![DNice](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@DNice](https://forum.inductiveautomation.com/u/DNice)\
**Post date:** [January 17, 2025, 8:44pm UTC](https://forum.inductiveautomation.com/t/script-console-browse-for-tag-providers/53011/14 "2025-01-17T20:44:08Z")

</div>

I found this to work for me using 8.1.43

```python
results = system.tag.browse()
for i in results: 
	print i['fullPath']

```
