# How to get components in Tag events?

**URL:** <https://forum.inductiveautomation.com/t/how-to-get-components-in-tag-events/53270>\
**Category:** Ignition\
**Created:** [November 19, 2021, 1:21am UTC](https://forum.inductiveautomation.com/t/how-to-get-components-in-tag-events/53270 "2021-11-19T01:21:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wangjun\_ming\_1996](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@wangjun\_ming\_1996](https://forum.inductiveautomation.com/u/wangjun_ming_1996)\
**Post date:** [November 19, 2021, 1:21am UTC](https://forum.inductiveautomation.com/t/how-to-get-components-in-tag-events/53270/1 "2021-11-19T01:21:00Z")

</div>

I want to get component Table’s data in Tag events  
How I can get it  
just like ’ event.source.parent.getcomponent()’ function.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/7/a7d379f9566222468f81568f4a2ea5ea86d8759f.png)

---

<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:** [November 19, 2021, 2:19am UTC](https://forum.inductiveautomation.com/t/how-to-get-components-in-tag-events/53270/2 "2021-11-19T02:19:11Z")

</div>

If what you are attempting to do is access a component directly from a tag event:

Short answer - you can’t.

Slightly longer answer:

Tag Events have no context to the GUI as they are gateway scoped. At any time there could be multiple clients/sessions open it would be impossible for a tag event to resolve which session you’re attempting to access the component in.

If what you are attempting to do is access a dataset which originates from a table, then what you need to do is create tag of type dataset which is bidirectionally bound to the table’s data property.

That’s a broad answer, but your question has left out quite a bit of needed detail for a better answer, IMHO.

---

<div class="post-metadata">

**Author:** ![wangjun\_ming\_1996](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@wangjun\_ming\_1996](https://forum.inductiveautomation.com/u/wangjun_ming_1996)\
**Post date:** [November 19, 2021, 2:37am UTC](https://forum.inductiveautomation.com/t/how-to-get-components-in-tag-events/53270/3 "2021-11-19T02:37:31Z")

</div>

OK thank you very much.  
I mean that if OPC Tag is triggered i will initialize the table component and write data to the Table and also read some Table data.  
So I can’t do that ,right?

---

<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 19, 2021, 9:22am UTC](https://forum.inductiveautomation.com/t/how-to-get-components-in-tag-events/53270/4 "2021-11-19T09:22:20Z")

</div>

Create a custom property on your window/view and bind it to your tag. Then use an on change script in that property to fire your client script

---

<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:** [November 19, 2021, 12:05pm UTC](https://forum.inductiveautomation.com/t/how-to-get-components-in-tag-events/53270/5 "2021-11-19T12:05:15Z")

</div>

You can’t do it in a tag event.

You can do it in other ways. @nminchin has shown one of those.

---

<div class="post-metadata">

**Author:** ![wangjun\_ming\_1996](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@wangjun\_ming\_1996](https://forum.inductiveautomation.com/u/wangjun_ming_1996)\
**Post date:** [November 19, 2021, 1:17pm UTC](https://forum.inductiveautomation.com/t/how-to-get-components-in-tag-events/53270/6 "2021-11-19T13:17:34Z")

</div>

Thank you very very very much 😊
