# Browsing available OPC servers based on a tag provider selection

**URL:** <https://forum.inductiveautomation.com/t/browsing-available-opc-servers-based-on-a-tag-provider-selection/67583>\
**Category:** Ignition\
**Tags:** ignition81, perspective, scripting\
**Created:** [December 13, 2022, 10:32pm UTC](https://forum.inductiveautomation.com/t/browsing-available-opc-servers-based-on-a-tag-provider-selection/67583 "2022-12-13T22:32:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex.narvais](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@alex.narvais](https://forum.inductiveautomation.com/u/alex.narvais)\
**Post date:** [December 13, 2022, 10:32pm UTC](https://forum.inductiveautomation.com/t/browsing-available-opc-servers-based-on-a-tag-provider-selection/67583/1 "2022-12-13T22:32:02Z")

</div>

I was trying to get a list of opc servers based on a tag provider. In the latest ignition designer this can be achieved when you select a tag provider from the drop down tag browser the opc browser updates with the relevant opc servers based on the tag provider selection with respect to which gateways the tag provider was created on.  
In my case I have multiple remote gateways connected to my main server.

The available system.opc functions only let you browse the opc servers on currently opened runtime.

Im curious how the opc browser is able to get updated based on the tag browser selection. I'm trying to get the opc servers available based on a user selected tag provider, so I can use those opc servers to build data in the perspective tree component?

---

<div class="post-metadata">

**Author:** ![Dechen\_Chuteng](https://avatars.discourse-cdn.com/v4/letter/d/9de0a6/32.png) [@Dechen\_Chuteng](https://forum.inductiveautomation.com/u/Dechen_Chuteng)\
**Post date:** [December 19, 2022, 11:10pm UTC](https://forum.inductiveautomation.com/t/browsing-available-opc-servers-based-on-a-tag-provider-selection/67583/2 "2022-12-19T23:10:32Z")

</div>

Hi alex.narvais,

I am not sure if I understand your question/post. Could you clarify some more?

If you are just looking to see the list of opc connections under Tag Browser, you can select System tags \> Gateway \> OPC folder \> Connections folder.

---

<div class="post-metadata">

**Author:** ![alex.narvais](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@alex.narvais](https://forum.inductiveautomation.com/u/alex.narvais)\
**Post date:** [July 26, 2024, 11:05pm UTC](https://forum.inductiveautomation.com/t/browsing-available-opc-servers-based-on-a-tag-provider-selection/67583/3 "2024-07-26T23:05:52Z")

</div>

This was solved awhile back, a few days after I posted this question and with that said I was able to achieve this by setting up Gateway Message Handlers between my main server and each of my tag servers

Each Tag Server has the following  
**get\_opc\_servers** message handler:

```python
def handleMessage(payload):
	return system.opc.getServers()

```

On my main server I just call the following system function to populate a Perspective Tree Component to view the results.

```python
results = system.util.sendRequest(project=proj_serv[0], messageHandler=message_handler, payload={"opc_server": opc_server, "node_id": node_id}, remoteServer=proj_serv[1])

```
