# Using system.tag.browse with relative path

**URL:** <https://forum.inductiveautomation.com/t/using-system-tag-browse-with-relative-path/47194>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [May 27, 2021, 3:10pm UTC](https://forum.inductiveautomation.com/t/using-system-tag-browse-with-relative-path/47194 "2021-05-27T15:10:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick.maltais](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/patrick.maltais/32/3958_2.png) [@patrick.maltais](https://forum.inductiveautomation.com/u/patrick.maltais)\
**Post date:** [May 27, 2021, 3:10pm UTC](https://forum.inductiveautomation.com/t/using-system-tag-browse-with-relative-path/47194/1 "2021-05-27T15:10:17Z")

</div>

Hi,  
I’m trying to browse a folder to find the tags configured in that folder. The script is executed in the Value Changed Event of a tag that is in an adjacent level from the path I wish to browse.

BaseFolder  
-CtrlFolder  
–ParseTag  
-MachineFolder  
–MachineTag1  
–MachineTag2

The Event Script is in “ParseTag” from “CtrlFolder” and I want to browse for tags in “MachineFolder”… My code looks like this:

```
path = "[.]../MachineFolder"
tagsData = system.tag.browse(path)

```

Normally, I should get a dictionnary containing data for “MachineTag1” and “MachineTag2” but there is an error in the Gateway Logs : Error browsing tags through scripting

Can anyone help?

Thanks

java.util.concurrent.ExecutionException: java.lang.Exception: provider not found: .

at java.base/java.util.concurrent.CompletableFuture.reportGet(Unknown Source)

at java.base/java.util.concurrent.CompletableFuture.get(Unknown Source)

at com.inductiveautomation.ignition.gateway.script.GatewayTagUtilities.browseImpl(GatewayTagUtilities.java:119)

at com.inductiveautomation.ignition.common.script.builtin.AbstractTagUtilities.browse(AbstractTagUtilities.java:344)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.base/java.lang.reflect.Method.invoke(Unknown Source)

at org.python.core.PyReflectedFunction. **call** (PyReflectedFunction.java:188)

at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction. **call** (ScriptManager.java:538)

at org.python.core.PyObject. **call** (PyObject.java:480)

at org.python.core.PyObject. **call** (PyObject.java:484)

at org.python.pycode.\_pyx21291.valueChanged$1(:49)

at org.python.pycode.\_pyx21291.call\_function()

at org.python.core.PyTableCode.call(PyTableCode.java:171)

at org.python.core.PyBaseCode.call(PyBaseCode.java:308)

at org.python.core.PyFunction.function\_\_\_call\_\_(PyFunction.java:471)

at org.python.core.PyFunction. **call** (PyFunction.java:466)

at org.python.core.PyFunction. **call** (PyFunction.java:461)

at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:836)

at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:820)

at com.inductiveautomation.ignition.gateway.tags.scripting.TagScriptManagerImpl$FunctionInvokerImpl.run(TagScriptManagerImpl.java:530)

at com.inductiveautomation.ignition.gateway.tags.scripting.events.AbstractTagScript.invoke(AbstractTagScript.java:34)

at com.inductiveautomation.ignition.gateway.tags.scripting.TagScriptManagerImpl$Task.invoke(TagScriptManagerImpl.java:479)

at com.inductiveautomation.ignition.gateway.tags.scripting.TagScriptManagerImpl$TagScriptDispatcher.run(TagScriptManagerImpl.java:442)

at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:538)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.base/java.util.concurrent.FutureTask.run(Unknown Source)

at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.base/java.lang.Thread.run(Unknown Source)

Caused by: java.lang.Exception: provider not found: .

at com.inductiveautomation.ignition.gateway.tags.model.impl.GatewayTagManagerImpl.browseAsync(GatewayTagManagerImpl.java:603)

… 30 common frames omitted

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [May 27, 2021, 3:34pm UTC](https://forum.inductiveautomation.com/t/using-system-tag-browse-with-relative-path/47194/2 "2021-05-27T15:34:10Z")

</div>

FWIW, I would strongly recommend against browsing tags in a tag event script.

> [@patrick.maltais](#):
>
> Caused by: java.lang.Exception: provider not found

looks like the browse function doesn't know the provider. I would say you probably need to provide the fully qualified tag path.

---

<div class="post-metadata">

**Author:** ![patrick.maltais](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/patrick.maltais/32/3958_2.png) [@patrick.maltais](https://forum.inductiveautomation.com/u/patrick.maltais)\
**Post date:** [May 27, 2021, 4:09pm UTC](https://forum.inductiveautomation.com/t/using-system-tag-browse-with-relative-path/47194/3 "2021-05-27T16:09:42Z")

</div>

Thanks @lrose  
Yes! That was the problem. If I change the [.] part for [MyProvider], it works.  
Is it possible to retrieve the provider using the Event parameters in some way?  
I use a tag event on a tag that I know will not change very often. It’s a trigger of some sort.  
The script in this event parses the structure and generates a json string with the key being the tag name. That json is passed to a database stored procedure. So if the structure is changed in the PLC, the json adapts automatically.  
What do you suggest to replace the Event Script with something more secure?  
Thanks for your help!

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [May 27, 2021, 5:41pm UTC](https://forum.inductiveautomation.com/t/using-system-tag-browse-with-relative-path/47194/4 "2021-05-27T17:41:09Z")

</div>

> [@patrick.maltais](#):
>
> The script in this event parses the structure and generates a json string with the key being the tag name. That json is passed to a database stored procedure. So if the structure is changed in the PLC, the json adapts automatically

Generally, since you are storing this in a DB, I would tend to recommend a Gateway Timer Event. The event would then check the PLC's copy of the structure against the DB copy and then choose to record a change or not.

You could also achieve this with a Gateway Tag Change Event on a Trigger Tag, then the device could be responsible for triggering the database operation.

> [@patrick.maltais](#):
>
> What do you suggest to replace the Event Script with something more secure?

It's less about security and more about execution time. Tag event scripts run in a limited thread pool, so best practice is to not execute potentially long running tasks there. Doing so can lead to missed events.

Here is a discussion on the topic.

> [@Tag Change Missed Events](http://forum.inductiveautomation.com/t/tag-change-missed-events/37764/2):
>
> Each tag has a queue, size 5, that change events get put into and pulled out of for execution. If your script is taking too long to execute and changes are happening quickly this queue will overflow and that flag will get set. When an overflow happens the oldest event (the head of the queue) is discarded to make room.

---

<div class="post-metadata">

**Author:** ![patrick.maltais](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/patrick.maltais/32/3958_2.png) [@patrick.maltais](https://forum.inductiveautomation.com/u/patrick.maltais)\
**Post date:** [May 27, 2021, 6:06pm UTC](https://forum.inductiveautomation.com/t/using-system-tag-browse-with-relative-path/47194/5 "2021-05-27T18:06:52Z")

</div>

Thanks @lrose! This will help! Case closed!
