# Is there a "this" type reference in the expression language?

**URL:** <https://forum.inductiveautomation.com/t/is-there-a-this-type-reference-in-the-expression-language/14757>\
**Category:** Ignition\
**Created:** [July 11, 2017, 4:35pm UTC](https://forum.inductiveautomation.com/t/is-there-a-this-type-reference-in-the-expression-language/14757 "2017-07-11T16:35:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![brian.mcenulty](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@brian.mcenulty](https://forum.inductiveautomation.com/u/brian.mcenulty)\
**Post date:** [July 11, 2017, 4:35pm UTC](https://forum.inductiveautomation.com/t/is-there-a-this-type-reference-in-the-expression-language/14757/1 "2017-07-11T16:35:27Z")

</div>

I have an expression binding on the border property of a container. I would like to use this container like a template without actually being a template if that makes sense, where there will be multiple containers on a single window. Within my expression I need the “name” property of the container. If there are multiple containers on a screen and depending on if things are grouped together or not, trying to get the name property of the container within the expression becomes a bit of a pain. Is there any way to reference the object, ie the container, that the binding is tied to? In java it might look something like “this.name” as a reference to the name.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 11, 2017, 4:45pm UTC](https://forum.inductiveautomation.com/t/is-there-a-this-type-reference-in-the-expression-language/14757/2 "2017-07-11T16:45:32Z")

</div>

There is not a way to do this within the expression language (might be good for [ideas.inductiveautomation.com](http://ideas.inductiveautomation.com)).

However, there is a workaround. I would caution that this can cause unnecessary CPU load, and so I would definitely recommend simply using a template. However, in an expression binding using `runScript`, `self` is available in the namespace. So: `runScript("self.name")` will return the name of the component that fired the 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:** [July 11, 2017, 5:53pm UTC](https://forum.inductiveautomation.com/t/is-there-a-this-type-reference-in-the-expression-language/14757/3 "2017-07-11T17:53:11Z")

</div>

Similarly, you can use the binding.target local variable in [objectScript()](https://inductiveautomation.com/moduleshowcase/module/automation-professionals-llc-simulation-aids) expressions. So: `objectScript("binding.target.name")` does the same as Paul’s example. The advantage of objectScript() is its ability to reference `binding.target` while computing a python one-liner that includes passed parameters (in `args`).

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [December 26, 2023, 4:11am UTC](https://forum.inductiveautomation.com/t/is-there-a-this-type-reference-in-the-expression-language/14757/4 "2023-12-26T04:11:14Z")

</div>

> **[Expression Component "This" Reference | Ignition Features and Ideas |...](https://ideas.inductiveautomation.com/ignition-features-and-ideas/p/expression-component-this-reference)**
>
> Really need a this/self reference in expressions to be able to specify custom properties on the component where the expression lives.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [December 26, 2023, 4:26am UTC](https://forum.inductiveautomation.com/t/is-there-a-this-type-reference-in-the-expression-language/14757/5 "2023-12-26T04:26:39Z")

</div>

Is this "this" not what is being requested?  
[https://docs.inductiveautomation.com/display/DOC81/Tag+Paths#TagPaths-Usingthe{this}Keyword](https://docs.inductiveautomation.com/display/DOC81/Tag+Paths#TagPaths-Usingthe%7Bthis%7DKeyword)

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [December 26, 2023, 4:39am UTC](https://forum.inductiveautomation.com/t/is-there-a-this-type-reference-in-the-expression-language/14757/6 "2023-12-26T04:39:36Z")

</div>

> [@jlandwerlen](#):
>
> [TagPaths-Usingthe{this}Keyword](https://docs.inductiveautomation.com/display/DOC81/Tag+Paths#TagPaths-Usingthe%7Bthis%7DKeyword)

Nope. It doesn't work for getting the value of a component property.
