# The tag({PathToTag}) doesn't work correctly in alarm expression binding

**URL:** <https://forum.inductiveautomation.com/t/the-tag-pathtotag-doesnt-work-correctly-in-alarm-expression-binding/40879>\
**Category:** Ignition Early Access\
**Created:** [November 23, 2020, 6:14am UTC](https://forum.inductiveautomation.com/t/the-tag-pathtotag-doesnt-work-correctly-in-alarm-expression-binding/40879 "2020-11-23T06:14:40Z")\
**Posts on this page:** 7\
**Page:** 1

<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:** [November 23, 2020, 6:14am UTC](https://forum.inductiveautomation.com/t/the-tag-pathtotag-doesnt-work-correctly-in-alarm-expression-binding/40879/1 "2020-11-23T06:14:40Z")

</div>

Hi

I try to get value of the current tag with tag({PathToTag}) expression binding in the Alarm Display Path, but it always return -1.

As {PathToTag} is always string type and show what is the tag Path it should work with tag() function.

---

<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:** [November 23, 2020, 10:16am UTC](https://forum.inductiveautomation.com/t/the-tag-pathtotag-doesnt-work-correctly-in-alarm-expression-binding/40879/2 "2020-11-23T10:16:42Z")

</div>

Wondering if you need the provider supplied? What version?  
Also, if it’s relative, try using relative addressing `tag('[.]../tag')`

---

<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:** [November 23, 2020, 10:40am UTC](https://forum.inductiveautomation.com/t/the-tag-pathtotag-doesnt-work-correctly-in-alarm-expression-binding/40879/3 "2020-11-23T10:40:47Z")

</div>

I already add provider in tagpath. 8.0.12  
Doesn’t work

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [November 23, 2020, 12:41pm UTC](https://forum.inductiveautomation.com/t/the-tag-pathtotag-doesnt-work-correctly-in-alarm-expression-binding/40879/4 "2020-11-23T12:41:25Z")

</div>

What happens if you add quotes?

```auto
'{PathToTag}'

```

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [November 23, 2020, 1:02pm UTC](https://forum.inductiveautomation.com/t/the-tag-pathtotag-doesnt-work-correctly-in-alarm-expression-binding/40879/5 "2020-11-23T13:02:31Z")

</div>

@nader.chinichian  
Works for me in 8.1.0-STABLE.  
I have a UDT called ForumTest with a child tag called RandomDouble2  
Here are the following results:

```auto
{PathToTag} # gives me ForumTest/RandomDouble2

```

```auto
tag({PathToTag}) # gives me the tag value 86.393

```

```auto
tag('{PathToTag}') # gives me ForumTest/RandomDouble2/Alarm

```

---

<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:** [November 23, 2020, 6:34pm UTC](https://forum.inductiveautomation.com/t/the-tag-pathtotag-doesnt-work-correctly-in-alarm-expression-binding/40879/6 "2020-11-23T18:34:40Z")

</div>

Hi  
Thanks it seems you are right in 8.1 release.  
By the way isnt it {PathToTag} string? So why we have to add "?

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [November 23, 2020, 6:50pm UTC](https://forum.inductiveautomation.com/t/the-tag-pathtotag-doesnt-work-correctly-in-alarm-expression-binding/40879/7 "2020-11-23T18:50:07Z")

</div>

{PathToTag} is a string. You don’t have to add “” to get a tags value (Your original code would have worked **tag({PathToTag})**).

I’m actually not sure why the below returns **ForumTest/RandomDouble2/Alarm**

```auto
 '{PathToTag}' 

```
