# Why does the tag provider crash with this expression?

**URL:** <https://forum.inductiveautomation.com/t/why-does-the-tag-provider-crash-with-this-expression/75630>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [June 28, 2023, 12:25pm UTC](https://forum.inductiveautomation.com/t/why-does-the-tag-provider-crash-with-this-expression/75630 "2023-06-28T12:25:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![BVTV](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@BVTV](https://forum.inductiveautomation.com/u/BVTV)\
**Post date:** [June 28, 2023, 12:25pm UTC](https://forum.inductiveautomation.com/t/why-does-the-tag-provider-crash-with-this-expression/75630/1 "2023-06-28T12:25:58Z")

</div>

Hi, I am using an expression tag in ignition. In the expression I have written is:  
" tag("[.]") "  
This makes the tag provider become unavailable.  
Is this because of some kind of infinite loop?

---

<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:** [June 28, 2023, 12:31pm UTC](https://forum.inductiveautomation.com/t/why-does-the-tag-provider-crash-with-this-expression/75630/2 "2023-06-28T12:31:37Z")

</div>

Yes.

---

<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:** [June 28, 2023, 12:40pm UTC](https://forum.inductiveautomation.com/t/why-does-the-tag-provider-crash-with-this-expression/75630/3 "2023-06-28T12:40:59Z")

</div>

What result were you hoping for with that expression?

---

<div class="post-metadata">

**Author:** ![BVTV](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@BVTV](https://forum.inductiveautomation.com/u/BVTV)\
**Post date:** [June 28, 2023, 12:52pm UTC](https://forum.inductiveautomation.com/t/why-does-the-tag-provider-crash-with-this-expression/75630/4 "2023-06-28T12:52:53Z")

</div>

The expression is not finished, but since it crashed, I gave up doing it that way.  
What I actually wanted was to read the value of a tag in the same folder. The plan was to do something like:  
tag("[.]/../siblingTag")  
But I did not get it to work.  
I need to use a string for the relative path to be able to change it through code later.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 28, 2023, 12:57pm UTC](https://forum.inductiveautomation.com/t/why-does-the-tag-provider-crash-with-this-expression/75630/5 "2023-06-28T12:57:54Z")

</div>

What version of Ignition are you using? I can't reproduce a crash or infinite loop.

---

<div class="post-metadata">

**Author:** ![BVTV](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@BVTV](https://forum.inductiveautomation.com/u/BVTV)\
**Post date:** [June 28, 2023, 1:07pm UTC](https://forum.inductiveautomation.com/t/why-does-the-tag-provider-crash-with-this-expression/75630/6 "2023-06-28T13:07:05Z")

</div>

I am using Ignition 8.1.27  
The datatype was string.  
What about this expression: tag("[.]/..")

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 28, 2023, 1:08pm UTC](https://forum.inductiveautomation.com/t/why-does-the-tag-provider-crash-with-this-expression/75630/7 "2023-06-28T13:08:57Z")

</div>

No, same nonsense value, but no crash:

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

---

<div class="post-metadata">

**Author:** ![BVTV](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@BVTV](https://forum.inductiveautomation.com/u/BVTV)\
**Post date:** [June 28, 2023, 2:02pm UTC](https://forum.inductiveautomation.com/t/why-does-the-tag-provider-crash-with-this-expression/75630/8 "2023-06-28T14:02:26Z")

</div>

This is what the error looks like when the expression is tag("[.]"):  
 ![CrashInTagprovider_Zoomed](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/e/becf84e8e252c541146213949582694a916cd2be.png)

---

<div class="post-metadata">

**Author:** ![BVTV](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@BVTV](https://forum.inductiveautomation.com/u/BVTV)\
**Post date:** [June 28, 2023, 2:04pm UTC](https://forum.inductiveautomation.com/t/why-does-the-tag-provider-crash-with-this-expression/75630/9 "2023-06-28T14:04:27Z")

</div>

Try using this UDT:  
{  
"name": "testUDT",  
"tagType": "UdtType",  
"tags": [  
{  
"valueSource": "reference",  
"name": "New Tag",  
"tagType": "AtomicTag"  
}  
]  
}

And this instance of it:  
{  
"name": "New Instance",  
"typeId": "testUDT",  
"tagType": "UdtInstance",  
"tags": [  
{  
"valueSource": "expr",  
"expression": "tag("[.]")",  
"dataType": "String",  
"name": "New Tag",  
"tagType": "AtomicTag"  
}  
]  
}

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 28, 2023, 2:43pm UTC](https://forum.inductiveautomation.com/t/why-does-the-tag-provider-crash-with-this-expression/75630/10 "2023-06-28T14:43:13Z")

</div>

Ok, that your expression tag was nested in a UDT instance was a relevant detail.

I'll file a bug report.
