# Expression Tag reference self?

**URL:** <https://forum.inductiveautomation.com/t/expression-tag-reference-self/28196>\
**Category:** Ignition\
**Created:** [September 12, 2019, 7:43am UTC](https://forum.inductiveautomation.com/t/expression-tag-reference-self/28196 "2019-09-12T07:43:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esn](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@Esn](https://forum.inductiveautomation.com/u/Esn)\
**Post date:** [September 12, 2019, 7:43am UTC](https://forum.inductiveautomation.com/t/expression-tag-reference-self/28196/1 "2019-09-12T07:43:08Z")

</div>

Hi,

Is there a way to get an expression tags own name within its own expression?

I’ve tried things like

[.].Name  
[.].name  
{[.]}.Name  
{[.]}.name  
tag([.])+’.Name’  
tag([.])+’.name’  
tag({[.]})+’.Name’  
tag({[.]})+’.name’  
tag({[.]}+’.Name’)  
tag({[.]}+’.name’)

But all fails…

Thanks

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [September 12, 2019, 12:04pm UTC](https://forum.inductiveautomation.com/t/expression-tag-reference-self/28196/2 "2019-09-12T12:04:32Z")

</div>

Use this

```auto
{[.]nameOfYourTagHere.Name}

```

---

<div class="post-metadata">

**Author:** ![Esn](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@Esn](https://forum.inductiveautomation.com/u/Esn)\
**Post date:** [September 13, 2019, 5:49am UTC](https://forum.inductiveautomation.com/t/expression-tag-reference-self/28196/3 "2019-09-13T05:49:44Z")

</div>

Thanks, but I was hoping for a solution where I wouldn’t need the actual name of the tag.  
Do you know if that’s possible?

---

<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:** [September 13, 2019, 12:26pm UTC](https://forum.inductiveautomation.com/t/expression-tag-reference-self/28196/4 "2019-09-13T12:26:42Z")

</div>

It’s not possible, at least not in v7.9. I’ve been meaning to check what is exposed in v8’s expression tags by my objectScript() function’s `binding` argument. The new tag group functionality suggests it won’t be null.

---

<div class="post-metadata">

**Author:** ![Esn](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@Esn](https://forum.inductiveautomation.com/u/Esn)\
**Post date:** [September 16, 2019, 5:53am UTC](https://forum.inductiveautomation.com/t/expression-tag-reference-self/28196/5 "2019-09-16T05:53:49Z")

</div>

Ok, thanks

---

<div class="post-metadata">

**Author:** ![Tim.Johnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim.johnson/32/10597_2.png) [@Tim.Johnson](https://forum.inductiveautomation.com/u/Tim.Johnson)\
**Post date:** [September 26, 2019, 8:42pm UTC](https://forum.inductiveautomation.com/t/expression-tag-reference-self/28196/6 "2019-09-26T20:42:51Z")

</div>

Great function, @pturmel, but I noticed that your objectScript() doesn’t trigger when the values change.

For example, I’ve got the following code on the background color of a numeric text input field:

```auto
if(objectScript("binding.target.floatValue") < objectScript("binding.target.minimum"),
	"Red", "White")

```

But when the values change (either when written from the input field, or read from source), the script doesn’t appear to run. When I change it to the following:

```auto
if({Root Container.Numeric Text Field 5.floatValue} < {Root Container.Numeric Text Field 5.minimum},
	"Red", "White")

```

then it functions as expected, triggering whenever the values update.

Any suggestions?

---

<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:** [September 26, 2019, 9:37pm UTC](https://forum.inductiveautomation.com/t/expression-tag-reference-self/28196/7 "2019-09-26T21:37:18Z")

</div>

Expected and unavoidable behavior, just like with runScript(). binding.target is intended for values you can’t get to any other way, or you deliberately want to exclude from re-triggering. Use the `args` feature to pass dynamic values to the python expression.

---

<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:** [September 26, 2019, 9:43pm UTC](https://forum.inductiveautomation.com/t/expression-tag-reference-self/28196/8 "2019-09-26T21:43:15Z")

</div>

Keep in mind that both runScript and objectScript have overhead from starting a python environment that pure expressions do not. Use them where other techniques are insufficient, and especially avoid changing the python expression string itself.

---

<div class="post-metadata">

**Author:** ![Tim.Johnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim.johnson/32/10597_2.png) [@Tim.Johnson](https://forum.inductiveautomation.com/u/Tim.Johnson)\
**Post date:** [September 27, 2019, 12:52am UTC](https://forum.inductiveautomation.com/t/expression-tag-reference-self/28196/9 "2019-09-27T00:52:30Z")

</div>

Fair enough. Thanks.

---

<div class="post-metadata">

**Author:** ![Bryan\_Mason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bryan_mason/32/30612_2.png) [@Bryan\_Mason](https://forum.inductiveautomation.com/u/Bryan_Mason)\
**Post date:** [April 13, 2022, 5:06pm UTC](https://forum.inductiveautomation.com/t/expression-tag-reference-self/28196/10 "2022-04-13T17:06:11Z")

</div>

I found there’s now a way to do this: [Reference self in tag expression?](https://forum.inductiveautomation.com/t/reference-self-in-tag-expression/46059)

Use `{this.name}` 🙂

---

<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:** [April 14, 2022, 12:38am UTC](https://forum.inductiveautomation.com/t/expression-tag-reference-self/28196/11 "2022-04-14T00:38:55Z")

</div>

Very cool 🙂

Oh wait, that was from my post… Haha, I’d completely forgotten about this

---

<div class="post-metadata">

**Author:** ![Esn](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@Esn](https://forum.inductiveautomation.com/u/Esn)\
**Post date:** [May 11, 2022, 8:26am UTC](https://forum.inductiveautomation.com/t/expression-tag-reference-self/28196/12 "2022-05-11T08:26:13Z")

</div>

Thanks Bryan and by extension nminchin 👌 I can’t remember why I needed it anymore 😆  
But good to have it for later I guess!
